Intentional wraparound used +
parent
9684c99dd3
commit
69129c2e93
|
@ -523,6 +523,8 @@ set(ZIG_STD_FILES
|
|||
"hash/crc.zig"
|
||||
"hash/fnv.zig"
|
||||
"hash/siphash.zig"
|
||||
"hash/murmur.zig"
|
||||
"hash/cityhash.zig"
|
||||
"hash_map.zig"
|
||||
"heap.zig"
|
||||
"heap/logging_allocator.zig"
|
||||
|
|
|
@ -217,7 +217,7 @@ pub const CityHash64 = struct {
|
|||
const len: u64 = @truncate(u64, str.len);
|
||||
if (len >= 8) {
|
||||
const mul: u64 = k2 +% len *% 2;
|
||||
const a: u64 = fetch64(str.ptr) + k2;
|
||||
const a: u64 = fetch64(str.ptr) +% k2;
|
||||
const b: u64 = fetch64(str.ptr + str.len - 8);
|
||||
const c: u64 = rotr64(b, 37) *% mul +% a;
|
||||
const d: u64 = (rotr64(a, 25) +% b) *% mul;
|
||||
|
|
Loading…
Reference in New Issue