From 89291990822d302ee7df6b0867948bc7fd0a9c05 Mon Sep 17 00:00:00 2001 From: Francisco Ryan Tolmasky I Date: Mon, 15 Feb 2010 22:48:28 -0800 Subject: [PATCH] Add CPFastEnumeration support for CPEnumerator. Reviewed by me. --- Foundation/CPArray.j | 5 +++++ Foundation/CPEnumerator.j | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/Foundation/CPArray.j b/Foundation/CPArray.j index 32dca638c..f3dd32481 100755 --- a/Foundation/CPArray.j +++ b/Foundation/CPArray.j @@ -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 */ diff --git a/Foundation/CPEnumerator.j b/Foundation/CPEnumerator.j index 51d25b92a..21084487f 100755 --- a/Foundation/CPEnumerator.j +++ b/Foundation/CPEnumerator.j @@ -56,4 +56,11 @@ return []; } + +- (int)countByEnumeratingWithState:(id)aState objects:(id)objects count:(id)aCount +{ + // This is pretty terrible, but what do you expect. + return [[self allObjects] countByEnumeratingWithState:aState objects:objects count:aCount]; +} + @end