Revision: 28860 http://sourceforge.net/p/bibdesk/svn/28860 Author: hofman Date: 2024-04-24 21:28:02 +0000 (Wed, 24 Apr 2024) Log Message: ----------- use enumeration of dictionary
Modified Paths: -------------- trunk/bibdesk/BDSKCompletionManager.m Modified: trunk/bibdesk/BDSKCompletionManager.m =================================================================== --- trunk/bibdesk/BDSKCompletionManager.m 2024-04-16 21:42:24 UTC (rev 28859) +++ trunk/bibdesk/BDSKCompletionManager.m 2024-04-24 21:28:02 UTC (rev 28860) @@ -251,14 +251,15 @@ [completions sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)]; - NSInteger i, count = [completions count]; - for (i = 0; i < count; i++) { - string = [completions objectAtIndex:i]; - if ([[string stringByRemovingCurlyBraces] isCaseInsensitiveEqual:matchString] == NO) { - *idx = i; - break; - } - } + __block NSInteger theIdx = -1; + [completions enumerateObjectsUsingBlock:^(NSString *str, NSUInteger i, BOOL *stop){ + if ([[str stringByRemovingCurlyBraces] isCaseInsensitiveEqual:matchString] == NO) { + theIdx = i; + *stop = YES; + } + }]; + if (theIdx >= 0) + *idx = theIdx; return completions; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Bibdesk-commit mailing list Bibdesk-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-commit