Permalink
Browse files

More minor clean up.

  • Loading branch information...
1 parent 8a70283 commit 95d94561d8fae0d4984408abc9592db0b1ae4b39 @beelsebob committed Mar 12, 2013
Showing with 9 additions and 9 deletions.
  1. +9 −9 Stash/STAMainWindowController.m
@@ -211,15 +211,15 @@ - (void)setResultNeedsDisplay:(STASymbol *)symbol forSearchString:(NSString *)se
if ([searchString isEqualToString:[self currentSearchString]])
{
[[self results] addObject:symbol];
- [[self sortedResults] insertObject:symbol
- atIndex:[[self sortedResults] indexOfObject:symbol
- inSortedRange:NSMakeRange(0, [[self sortedResults] count])
- options:NSBinarySearchingInsertionIndex
- usingComparator:^ NSComparisonResult (id a, id b)
- {
- return [a compare:b];
- }]];
- [[self resultsTable] insertRowsAtIndexes:[NSIndexSet indexSetWithIndex:[[self sortedResults] indexOfObject:symbol]] withAnimation:0];
+ NSUInteger insertionIndex = [[self sortedResults] indexOfObject:symbol
+ inSortedRange:NSMakeRange(0, [[self sortedResults] count])
+ options:NSBinarySearchingInsertionIndex
+ usingComparator:^ NSComparisonResult (id a, id b)
+ {
+ return [a compare:b];
+ }];
+ [[self sortedResults] insertObject:symbol atIndex:insertionIndex];
+ [[self resultsTable] insertRowsAtIndexes:[NSIndexSet indexSetWithIndex:insertionIndex] withAnimation:0];
if ([[self resultsTable] selectedRow] != 0)
{
[[self resultsTable] selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO];

0 comments on commit 95d9456

Please sign in to comment.