mirror of
https://github.com/denisidoro/navi
synced 2025-02-16 12:38:28 +00:00
Simplify hash code (#414)
This commit is contained in:
parent
a63a11c099
commit
5a758f00e1
1 changed files with 2 additions and 6 deletions
|
@ -22,13 +22,9 @@ impl Hasher for FnvHasher {
|
|||
}
|
||||
|
||||
fn write(&mut self, bytes: &[u8]) {
|
||||
let FnvHasher(mut hash) = *self;
|
||||
|
||||
for byte in bytes.iter() {
|
||||
hash ^= u64::from(*byte);
|
||||
hash = hash.wrapping_mul(0x0100_0000_01b3);
|
||||
self.0 ^= u64::from(*byte);
|
||||
self.0 = self.0.wrapping_mul(0x0100_0000_01b3);
|
||||
}
|
||||
|
||||
*self = FnvHasher(hash);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue