From 1e809aad3a187a284fc2c8f79dceda891deafc8a Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Fri, 15 Feb 2013 00:55:46 -0500 Subject: [PATCH] rm FIXME from LinearMap's to_bucket There are no more poor hash functions left in the codebase, and it makes sense to rely on there being a good hash function thanks to the inclusion of SipHash and the ease of using it with custom types. Closes #3041 --- src/libcore/hashmap.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libcore/hashmap.rs b/src/libcore/hashmap.rs index 9ec91d38515..8d4a1345146 100644 --- a/src/libcore/hashmap.rs +++ b/src/libcore/hashmap.rs @@ -76,10 +76,8 @@ pub mod linear { priv impl LinearMap { #[inline(always)] pure fn to_bucket(&self, h: uint) -> uint { - // FIXME(#3041) borrow a more sophisticated technique here from - // Gecko, for example borrowing from Knuth, as Eich so - // colorfully argues for here: - // https://bugzilla.mozilla.org/show_bug.cgi?id=743107#c22 + // A good hash function with entropy spread over all of the + // bits is assumed. SipHash is more than good enough. h % self.buckets.len() }