diff --git a/src/bench.zig b/src/bench.zig index 3149bf9..38dd2b4 100644 --- a/src/bench.zig +++ b/src/bench.zig @@ -2,10 +2,10 @@ const std = @import("std"); const HashArrayMappedTrie = @import("hamt").HashArrayMappedTrie; const StringContext = struct { - pub const Digest = u64; + pub const Digest = u32; pub fn hash(input: []const u8) Digest { - return std.hash.Wyhash.hash(0, input); + return @truncate(std.hash.Wyhash.hash(0, input)); } pub fn eql(left: []const u8, right: []const u8) bool { diff --git a/src/trie.zig b/src/trie.zig index c7553c4..d449727 100644 --- a/src/trie.zig +++ b/src/trie.zig @@ -181,7 +181,7 @@ pub fn HashArrayMappedTrie(comptime K: type, comptime V: type, comptime Context: } } - fn tableIdx(hash: Digest, offset: u16) Log2Int(Digest) { + inline fn tableIdx(hash: Digest, offset: u16) Log2Int(Digest) { const shift_amt: Log2Int(Digest) = @intCast(table_size - offset); return @truncate(hash >> shift_amt);