Revision: 11395
http://bibdesk.svn.sourceforge.net/bibdesk/?rev=11395&view=rev
Author: hofman
Date: 2007-10-26 04:31:20 -0700 (Fri, 26 Oct 2007)
Log Message:
-----------
More efficient way to get number of indexes in a range.
Modified Paths:
--------------
branches/TRY_ARM_FILE_INTERFACE/bibdesk/BibItem.m
Modified: branches/TRY_ARM_FILE_INTERFACE/bibdesk/BibItem.m
===================================================================
--- branches/TRY_ARM_FILE_INTERFACE/bibdesk/BibItem.m 2007-10-26 11:13:35 UTC
(rev 11394)
+++ branches/TRY_ARM_FILE_INTERFACE/bibdesk/BibItem.m 2007-10-26 11:31:20 UTC
(rev 11395)
@@ -2525,9 +2525,10 @@
NSArray *toMove = [[files objectsAtIndexes:aSet] copy];
unsigned anIdx = [aSet indexLessThanIndex:idx];
// reduce idx by the number of smaller indexes in aSet
- while (anIdx != NSNotFound) {
- idx--;
- anIdx = [aSet indexLessThanIndex:anIdx];
+ if (idx > 0) {
+ NSRange range = NSMakeRange(0, idx);
+ unsigned int buffer[idx];
+ idx -= [aSet getIndexes:buffer maxCount:idx inIndexRange:&range];
}
[files removeObjectsAtIndexes:aSet];
[files insertObjects:toMove atIndexes:[NSIndexSet
indexSetWithIndexesInRange:NSMakeRange(idx, [toMove count])]];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit