On Aug 19, 2009, at 6:17 PM, Gideon King wrote:
In other cases where I make few changes but do lots of comparisons, I might use the string hash idea and cache the return value in the object, triggering an update whenever the relevant data changes. This would be easy for me because the objects in question can archive themselves to XML and I could use the XML string.
Note that you must not change the hash of an object while it is in a hashing collection; this causes bugs that can be really hard to track down (I learned the hard way). See this article, specifically the note on "The mutable pitfall."
http://www.mulle-kybernetik.com/artikel/Optimization/opti-7.htmlSome of the comments on Apple's implementation are likely dated, but it's still good background reading.
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ 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