Re: NSMutableArray + NSEnumerator = No Memory
Re: NSMutableArray + NSEnumerator = No Memory
- Subject: Re: NSMutableArray + NSEnumerator = No Memory
- From: James Bucanek <email@hidden>
- Date: Mon, 24 Sep 2007 10:01:45 -0700
Alastair Houghton <mailto:email@hidden> wrote
(Monday, September 24, 2007 7:58 AM +0100):
If the code Chris gave is too slow, you could:
1. Change it to get an IMP for -objectAtIndex:, then re-test.
2. Change it to use CFArrayGetValueAtIndex(), then re-test.
Those are excellent suggestions.
For the record, I replaced my NSEnumerator with a loop that
calls -[NSArray count] once to get the size, then calls
-[NSArray objectAtIndex:] for each element. The performance is
essentially identical to the loop that uses NSEnumerator (within 1%).
--
James Bucanek
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden