On Thu, Oct 23, 2008 at 2:49 PM, DKJ <[EMAIL PROTECTED]> wrote:

> On 23 Oct, 2008, at 11:26, Finlay Dobbie wrote:
>
>> I'm surprised nobody else has picked up on this - how is enumerating
>> an NSArray going to be faster than enumerating a C array?
>>
>
> I was referring to this:
>
>        for( TheClass *obj in TheArray ) {}
>
> as fast enumeration.


That's faster (and simpler) to *write*, but it performs no better than
enumerating a C array. It is, in fact, implemented by sending
-countByEnumeratingWithState:objects:count: to the array, then enumerating
over the C array that's returned by reference from that method.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to