On 24/09/2009, at 9:15 AM, Jens Alfke wrote:

On Sep 23, 2009, at 2:27 PM, Matt Gough wrote:

        NSEnumerator *iter = [myMutableArray objectEnumerator];

        while (syncInfo = [iter nextObject]) {
                ... Do some stuff
        }

That's not a fast enumerator; that's the old-fashioned slow enumerator.


I thought that NSEnumerator was implemented in terms of fast enumeration "underneath" - the docs seem to imply that, as does the existence of __NSFastEnumerationEnumerator private class. It may be still slower than directly using the fast enumeration syntax, but isn't there some gain to be had? I have hundreds of these enumeration loops and I still need to support 10.4; I thought I was getting *some* benefit automagically from fast enumeration on 10.5+

Also, wouldn't methods such as -makeObjectsPerformSelector:withObject: and CFArrayApplyFunction(...) gain some benefit from fast enumeration? I use these a lot too.

--Graham


_______________________________________________

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 arch...@mail-archive.com

Reply via email to