Re: When do I need to override hash?
Re: When do I need to override hash?
- Subject: Re: When do I need to override hash?
- From: David Duncan <email@hidden>
- Date: Thu, 20 Aug 2009 14:42:14 -0700
Yup, and my mistake in the suggestion :). Probably juggling too many
balls int he air again today...
On Aug 20, 2009, at 2:16 PM, Clark Cox wrote:
I thought we were talking about -hash just returning zero?
--Kyle Sluder
No, we were talking about:
It is, but you can generally do better than just returning 0,
usually by just extracting some bits from 'self', ala
-(NSUInteger)hash
{
uintptr_t hash = (uintptr_t)self;
return (hash >> 4);
}
--
David Duncan
Apple DTS Animation and Printing
_______________________________________________
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