diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-10-19 14:17:03 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-10-20 20:02:35 -0400 |
| commit | bd1f96869e8a3cf31688c16cd0baffb65119d5eb (patch) | |
| tree | e4b3d5212f5c758fc01bd04a49c8fccb416bdfb9 /src | |
| parent | 328ec15d9cae0373c1f973699c392db5b63ab886 (diff) | |
| download | zig-bd1f96869e8a3cf31688c16cd0baffb65119d5eb.tar.gz zig-bd1f96869e8a3cf31688c16cd0baffb65119d5eb.zip | |
InternPool: fix incomplete hash of pointer values
There is this `common` prefix which was not getting passed in all union
tags of pointer vals, resumably making InternPool slower for pointer
values.
Diffstat (limited to 'src')
| -rw-r--r-- | src/InternPool.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/InternPool.zig b/src/InternPool.zig index 36a5c65deb..8cf121896d 100644 --- a/src/InternPool.zig +++ b/src/InternPool.zig @@ -1228,7 +1228,7 @@ pub const Key = union(enum) { .mut_decl => |x| Hash.hash( seed2, - asBytes(&x.decl) ++ asBytes(&x.runtime_index), + common ++ asBytes(&x.decl) ++ asBytes(&x.runtime_index), ), .anon_decl, @@ -1236,11 +1236,11 @@ pub const Key = union(enum) { .eu_payload, .opt_payload, .comptime_field, - => |int| Hash.hash(seed2, asBytes(&int)), + => |int| Hash.hash(seed2, common ++ asBytes(&int)), .elem, .field => |x| Hash.hash( seed2, - asBytes(&x.base) ++ asBytes(&x.index), + common ++ asBytes(&x.base) ++ asBytes(&x.index), ), }; }, |
