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
This commit is contained in:
parent
5a9da65dc9
commit
1e809aad3a
@ -76,10 +76,8 @@ pub fn linear_map_with_capacity<K: Eq Hash, V>(
|
||||
priv impl<K: Hash IterBytes Eq, V> LinearMap<K, V> {
|
||||
#[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()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user