Revision: 6425
http://skim-app.svn.sourceforge.net/skim-app/?rev=6425&view=rev
Author: hofman
Date: 2010-04-06 17:34:58 +0000 (Tue, 06 Apr 2010)
Log Message:
-----------
fix fast enumeration of custom array
Modified Paths:
--------------
trunk/SKIBArray.m
Modified: trunk/SKIBArray.m
===================================================================
--- trunk/SKIBArray.m 2010-04-06 17:28:53 UTC (rev 6424)
+++ trunk/SKIBArray.m 2010-04-06 17:34:58 UTC (rev 6425)
@@ -69,11 +69,15 @@
}
- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state
objects:(id *)stackbuf count:(NSUInteger)len {
- static const unsigned long const_mu = 1;
- state->state = 1;
- state->itemsPtr = object;
- state->mutationsPtr = (unsigned long *)&const_mu;
- return [self count];
+ enum { ATSTART = 0, ATEND = 1 };
+ if (state->state == ATSTART) {
+ static const unsigned long const_mu = 1;
+ state->state = ATEND;
+ state->itemsPtr = object;
+ state->mutationsPtr = (unsigned long *)&const_mu;
+ return [self count];
+ }
+ return 0;
}
@end
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit