1818// thus murmur2-hash is used
1919
2020
21- // specializations of https://github.com/aappleby/smhasher/blob/master/src/MurmurHash2.cpp
22- // it is possible to have a special x64-version, which would need less operations, but
23- // using 32bit version always has also some benifits:
24- // - one code for 32bit and 64bit builds
25- // - the same case for 32bit and 64bit builds
26- // - no performance difference could be measured compared to a possible x64-version
27-
28- khint32_t PANDAS_INLINE murmur2_32_32to32 (khint32_t k1 , khint32_t k2 ){
21+ // specializations of
22+ // https://github.com/aappleby/smhasher/blob/master/src/MurmurHash2.cpp
23+ // it is possible to have a special x64-version, which would need less
24+ // operations,but using 32bit version always has also some benifits:
25+ // - one code for 32bit and 64bit builds
26+ // - the same case for 32bit and 64bit builds
27+ // - no performance difference could be measured compared
28+ // to a possible x64-version
29+
30+ khint32_t PANDAS_INLINE murmur2_32_32to32 (khint32_t k1 , khint32_t k2 ) {
2931 const khint32_t SEED = 0xc70f6907UL ;
3032 // 'm' and 'r' are mixing constants generated offline.
3133 // They're not really 'magic', they just happen to work well.
@@ -35,15 +37,15 @@ khint32_t PANDAS_INLINE murmur2_32_32to32(khint32_t k1, khint32_t k2){
3537 // Initialize the hash to a 'random' value
3638 khint32_t h = SEED ^ 4 ;
3739
38- //handle first 4 bytes:
40+ // handle first 4 bytes:
3941 k1 *= M_32 ;
4042 k1 ^= k1 >> R_32 ;
4143 k1 *= M_32 ;
4244
4345 h *= M_32 ;
4446 h ^= k1 ;
4547
46- //handle second 4 bytes:
48+ // handle second 4 bytes:
4749 k2 *= M_32 ;
4850 k2 ^= k2 >> R_32 ;
4951 k2 *= M_32 ;
@@ -59,7 +61,7 @@ khint32_t PANDAS_INLINE murmur2_32_32to32(khint32_t k1, khint32_t k2){
5961 return h ;
6062}
6163
62- khint32_t PANDAS_INLINE murmur2_64to32 (khint64_t k ){
64+ khint32_t PANDAS_INLINE murmur2_64to32 (khint64_t k ) {
6365 khint32_t k1 = (khint32_t )k ;
6466 khint32_t k2 = (khint32_t )(k >> 32 );
6567
@@ -76,13 +78,13 @@ khint64_t PANDAS_INLINE asint64(double key) {
7678#define ZERO_HASH 0
7779#define NAN_HASH 0
7880
79- khint32_t PANDAS_INLINE kh_float64_hash_func (double val ){
81+ khint32_t PANDAS_INLINE kh_float64_hash_func (double val ) {
8082 // 0.0 and -0.0 should have the same hash:
81- if (val == 0.0 ){
83+ if (val == 0.0 ) {
8284 return ZERO_HASH ;
8385 }
8486 // all nans should have the same hash:
85- if ( val != val ){
87+ if ( val != val ) {
8688 return NAN_HASH ;
8789 }
8890 khint64_t as_int = asint64 (val );
0 commit comments