Re: NSArray lookup, pointer comparison
Re: NSArray lookup, pointer comparison
- Subject: Re: NSArray lookup, pointer comparison
- From: Andrew Farmer <email@hidden>
- Date: Tue, 29 May 2007 14:12:13 -0700
On 29 May 07, at 10:51, Keith Duncan wrote:
I'm iterating over a tree of objects but instead of iterating the
tree multiple times I decided to iterate the tree once and put the
nodes into an array. This allows me to check for the presence of
various objects quickly, for the purposes of this discussion two
objects are deemed to be equal if a pointer comparison is true.
Essentially what I'm looking for is the quickest way to determine
if any of the objects stored in another array, are no longer
present in the content array, that is the array derived from the
content tree.
Use an NSSet instead of an array? NSSet has a containsObject: method,
which should be much faster than scanning over an array.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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