From 4aa3824a2a6d0d4582351822546bb96b6ddb84aa Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Fri, 17 Feb 2012 14:05:03 +0000 Subject: [PATCH] Minor collection view optimisation. --- AppKit/CPCollectionView.j | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AppKit/CPCollectionView.j b/AppKit/CPCollectionView.j index 24116562d..014bce090 100644 --- a/AppKit/CPCollectionView.j +++ b/AppKit/CPCollectionView.j @@ -340,19 +340,19 @@ */ - (void)setSelectionIndexes:(CPIndexSet)anIndexSet { - if ([_selectionIndexes isEqual:anIndexSet] || !_isSelectable) + if (!_isSelectable || [_selectionIndexes isEqual:anIndexSet]) return; var index = CPNotFound; - while ((index = [_selectionIndexes indexGreaterThanIndex:index]) != CPNotFound) + while ((index = [_selectionIndexes indexGreaterThanIndex:index]) !== CPNotFound) [_items[index] setSelected:NO]; _selectionIndexes = anIndexSet; var index = CPNotFound; - while ((index = [_selectionIndexes indexGreaterThanIndex:index]) != CPNotFound) + while ((index = [_selectionIndexes indexGreaterThanIndex:index]) !== CPNotFound) [_items[index] setSelected:YES]; var binderClass = [[self class] _binderClassForBinding:@"selectionIndexes"];