On Aug 23, 2008, at 5:20 PM, Peter Duniho wrote:

Date: Sat, 23 Aug 2008 12:05:44 -0700
From: "Adam R. Maxwell" <[EMAIL PROTECTED]>



[...]

Note the redundant multiply and add in the first line. Writing the code that way makes it easy to add/remove members if for some reason the data structure should change in the future. But it would be just as correct to simply initialize ret to the first hash value, of course.

Thanks for the example...I need to find time to do some profiling with this.

Presumably that
depends on the hash table implementation as well.

Well, if your hash values collide, they collide regardless of the hash table. As long as you've got a well-distributed hash function, any collisions generated by the hash table implementation should be well-distributed as well.

My understanding was that the table might not use all bits of the hash value, so even differing hash values could be placed in the same bucket; that may be a misinterpretation of [1]. I find CFSet/CFBag/ CFDictionary to be one of the more confusing implementations in CF-Lite.

thanks,
Adam

[1] http://www.mulle-kybernetik.com/artikel/Optimization/opti-7.html

Attachment: 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 [EMAIL PROTECTED]

Reply via email to