Skip to content

Commit 1e809aa

Browse files
committed
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 rust-lang#3041
1 parent 5a9da65 commit 1e809aa

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/libcore/hashmap.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@ pub mod linear {
7676
priv impl<K: Hash IterBytes Eq, V> LinearMap<K, V> {
7777
#[inline(always)]
7878
pure fn to_bucket(&self, h: uint) -> uint {
79-
// FIXME(#3041) borrow a more sophisticated technique here from
80-
// Gecko, for example borrowing from Knuth, as Eich so
81-
// colorfully argues for here:
82-
// https://bugzilla.mozilla.org/show_bug.cgi?id=743107#c22
79+
// A good hash function with entropy spread over all of the
80+
// bits is assumed. SipHash is more than good enough.
8381
h % self.buckets.len()
8482
}
8583

0 commit comments

Comments
 (0)