Intentional wraparound used +

This commit is contained in:
andersfr 2019-07-13 13:57:32 +02:00
parent 9684c99dd3
commit 69129c2e93
2 changed files with 3 additions and 1 deletions

View File

@ -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"

View File

@ -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;