diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-02-28 20:37:37 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-02-28 20:38:24 -0700 |
| commit | f7d095d37267658ba0dc3a7e9c1506a9bbab0b49 (patch) | |
| tree | 329861a3d8e8c0a6f8a3a38bf76a197d0f1c5f5a /src | |
| parent | 30688f33a46e50877ee83d37bde7b6f0be907522 (diff) | |
| download | zig-f7d095d37267658ba0dc3a7e9c1506a9bbab0b49.tar.gz zig-f7d095d37267658ba0dc3a7e9c1506a9bbab0b49.zip | |
use hash.addListOfBytes where applicable
Diffstat (limited to 'src')
| -rw-r--r-- | src/Compilation.zig | 5 | ||||
| -rw-r--r-- | src/link/Wasm.zig | 10 |
2 files changed, 3 insertions, 12 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index e548703662..5e6ccf6c81 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2584,10 +2584,7 @@ fn addNonIncrementalStuffToCacheManifest( man.hash.addOptional(opts.initial_memory); man.hash.addOptional(opts.max_memory); man.hash.addOptional(opts.global_base); - man.hash.add(opts.export_symbol_names.len); - for (opts.export_symbol_names) |symbol_name| { - man.hash.addBytes(symbol_name); - } + man.hash.addListOfBytes(opts.export_symbol_names); // Mach-O specific stuff try link.File.MachO.hashAddFrameworks(man, opts.frameworks); diff --git a/src/link/Wasm.zig b/src/link/Wasm.zig index 455dfa79c6..ecb0ed7115 100644 --- a/src/link/Wasm.zig +++ b/src/link/Wasm.zig @@ -3535,11 +3535,8 @@ fn linkWithZld(wasm: *Wasm, arena: Allocator, prog_node: *std.Progress.Node) lin man.hash.addOptional(wasm.initial_memory); man.hash.addOptional(wasm.max_memory); man.hash.addOptional(wasm.global_base); - man.hash.add(wasm.export_symbol_names.len); + man.hash.addListOfBytes(wasm.export_symbol_names); // strip does not need to go into the linker hash because it is part of the hash namespace - for (wasm.export_symbol_names) |symbol_name| { - man.hash.addBytes(symbol_name); - } // We don't actually care whether it's a cache hit or miss; we just need the digest and the lock. _ = try man.hit(); @@ -4605,11 +4602,8 @@ fn linkWithLLD(wasm: *Wasm, arena: Allocator, prog_node: *std.Progress.Node) !vo man.hash.addOptional(wasm.max_memory); man.hash.add(shared_memory); man.hash.addOptional(wasm.global_base); - man.hash.add(wasm.export_symbol_names.len); + man.hash.addListOfBytes(wasm.export_symbol_names); // strip does not need to go into the linker hash because it is part of the hash namespace - for (wasm.export_symbol_names) |symbol_name| { - man.hash.addBytes(symbol_name); - } // We don't actually care whether it's a cache hit or miss; we just need the digest and the lock. _ = try man.hit(); |
