File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -64,11 +64,6 @@ fn hash_with_seed<T: Hash + ?Sized>(iter: u64, v: &T) -> u64 {
6464 state. finish ( )
6565}
6666
67- #[ inline]
68- fn hash_with_seed32 < T : Hash + ?Sized > ( iter : u64 , v : & T ) -> u32 {
69- fold ( hash_with_seed ( iter, v) )
70- }
71-
7267#[ inline]
7368fn fastmod ( hash : u32 , n : u32 ) -> u64 {
7469 ( ( hash as u64 ) * ( n as u64 ) ) >> 32
@@ -78,11 +73,10 @@ fn fastmod(hash: u32, n: u32) -> u64 {
7873fn hashmod < T : Hash + ?Sized > ( iter : u64 , v : & T , n : u64 ) -> u64 {
7974 // when n < 2^32, use the fast alternative to modulo described here:
8075 // https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
76+ let h = hash_with_seed ( iter, v) ;
8177 if n < ( 1 << 32 ) {
82- let h = hash_with_seed32 ( iter, v) ;
83- fastmod ( h, n as u32 ) as u64
78+ fastmod ( fold ( h) , n as u32 ) as u64
8479 } else {
85- let h = hash_with_seed ( iter, v) ;
8680 h % ( n as u64 )
8781 }
8882}
You can’t perform that action at this time.
0 commit comments