Revert "Pulled @each out into a separate feature branch, so as to not conflict with the 0.8 work: http://github.com/280north/cappuccino/tree/@each ."

This reverts commit 7433c38d92.
This commit is contained in:
Francisco Ryan Tolmasky I committed 2010-02-22 02:25:39 -08:00
1 parent d879b25458
commit 458481af4e
9 files changed
+509

No files matched your search

+30
View File
@@ -55,6 +55,11 @@
return [_array objectAtIndex:_index];
}
- (int)countByEnumeratingWithState:(id)aState objects:(id)objects count:(id)aCount
{
return [_array countByEnumeratingWithState:aState objects:objects count:aCount];
}
@end
/* @ignore */
@@ -1206,6 +1211,31 @@
@end
@implementation CPArray (CPFastEnumeration)
- (int)countByEnumeratingWithState:(id)aState objects:(id)objects count:(id)aCount
{
var count = [self count],
index = aState.state;
if (index >= count)
return 0;
var indexIndex = 0,
last = MIN(index + aCount, count);
aCount = last - index;
for (; index < last; ++index, ++indexIndex)
objects[indexIndex] = [self objectAtIndex:index];
aState.state = last;
return aCount;
}
@end
@implementation CPArray (CPCoding)
- (id)initWithCoder:(CPCoder)aCoder