Remove uneeded outside iteration and get the lastIndex more efficiently, also cleanup NSLog per @fredkiefer

This commit is contained in:
Gregory John Casamento 2024-08-08 17:44:04 -04:00
parent d8c4c14018
commit 0ab960e6fc
2 changed files with 1 additions and 10 deletions

View file

@ -335,10 +335,9 @@
if ([self canAddChild]
&& [self countKeyPath] == nil)
{
NSUInteger length = [indexPath length] - 1;
NSUInteger length = [indexPath length];
NSUInteger pos = 0;
NSMutableArray *children = [_arranged_objects mutableChildNodes];
NSUInteger lastIndex = 0;
for (pos = 0; pos < length; pos++)
{
@ -348,11 +347,6 @@
children = [node valueForKeyPath: _childrenKeyPath];
}
lastIndex = [indexPath indexAtPosition: length];
id child = [children objectAtIndex: lastIndex];
children = [child valueForKeyPath: _childrenKeyPath];
[children addObject: object];
[self rearrangeObjects];

View file

@ -154,7 +154,6 @@
- (NSIndexPath*) indexPath
{
NSLog(@"In %@", NSStringFromSelector(_cmd));
if (_parentNode != nil)
{
NSIndexPath *path;
@ -170,8 +169,6 @@
{
return [NSIndexPath indexPathWithIndex: index];
}
NSLog(@"index = %ld", index);
}
else
{