Fixed: the CPArrayController addObject: optimization for fast index updates would never fire with a nil _filterPredicate, causing rearrangeObjects to be called needlessly.

This commit is contained in:
Alexander Ljungberg
2010-05-26 19:39:09 -04:00
parent f7e2e9c2ee
commit 6ea2b4e0e2
+2 -2
View File
@@ -352,11 +352,11 @@
if (_clearsFilterPredicateOnInsertion)
[self setFilterPredicate:nil];
if ([_filterPredicate evaluateWithObject:object])
if (_filterPredicate === nil || [_filterPredicate evaluateWithObject:object])
{
[self willChangeValueForKey:@"selectionIndexes"];
var pos = [_arrangedObjects insertObject:object inArraySortedByDescriptors:_sortDescriptors];
[self willChangeValueForKey:@"selectionIndexes"];
[_selectionIndexes shiftIndexesStartingAtIndex:pos by:1];
[self didChangeValueForKey:@"selectionIndexes"];
}