Revision: 5945
http://skim-app.svn.sourceforge.net/skim-app/?rev=5945&view=rev
Author: hofman
Date: 2009-10-24 12:51:41 +0000 (Sat, 24 Oct 2009)
Log Message:
-----------
use fast enumeration
Modified Paths:
--------------
trunk/PDFAnnotationMarkup_SKExtensions.m
trunk/PDFSelection_SKExtensions.m
Modified: trunk/PDFAnnotationMarkup_SKExtensions.m
===================================================================
--- trunk/PDFAnnotationMarkup_SKExtensions.m 2009-10-24 12:32:36 UTC (rev
5944)
+++ trunk/PDFAnnotationMarkup_SKExtensions.m 2009-10-24 12:51:41 UTC (rev
5945)
@@ -78,10 +78,9 @@
{
if (strings == nil)
return nil;
- NSInteger i, iMax = [strings count];
- NSMutableArray *points = [[NSMutableArray alloc] initWithCapacity:iMax];
- for (i = 0; i < iMax; i++) {
- NSPoint p = NSPointFromString([strings objectAtIndex:i]);
+ NSMutableArray *points = [[NSMutableArray alloc] init];
+ for (NSString *string in strings) {
+ NSPoint p = NSPointFromString(string);
NSValue *value = [[NSValue alloc] initWithBytes:&p
objCType:@encode(NSPoint)];
[points addObject:value];
[value release];
Modified: trunk/PDFSelection_SKExtensions.m
===================================================================
--- trunk/PDFSelection_SKExtensions.m 2009-10-24 12:32:36 UTC (rev 5944)
+++ trunk/PDFSelection_SKExtensions.m 2009-10-24 12:51:41 UTC (rev 5945)
@@ -247,12 +247,10 @@
static inline NSRange rangeOfSubstringOfStringAtIndex(NSString *string,
NSArray *substrings, NSUInteger anIndex) {
NSUInteger length = [string length];
NSRange range = NSMakeRange(0, 0);
- NSUInteger i, iMax = [substrings count];
- if (anIndex >= iMax)
+ if (anIndex >= [substrings count])
return NSMakeRange(NSNotFound, 0);
- for (i = 0; i <= anIndex; i++) {
- NSString *substring = [substrings objectAtIndex:i];
+ for (NSString *substring in substrings) {
NSRange searchRange = NSMakeRange(NSMaxRange(range), length -
NSMaxRange(range));
if ([substring length] == 0)
continue;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit