diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-03-21 19:53:24 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-03-21 19:56:30 -0700 |
| commit | 2f4bbd6c637782eb985860255cf70011bbadd452 (patch) | |
| tree | 8baa0a2c003b66c3e449af9d73bc33985d13d0f3 /src/Compilation.zig | |
| parent | ebec7336e23404ab091d34303055cd3b8a0088a5 (diff) | |
| download | zig-2f4bbd6c637782eb985860255cf70011bbadd452.tar.gz zig-2f4bbd6c637782eb985860255cf70011bbadd452.zip | |
std.Build.Cache: use an array hash map for files
Rather than an ArrayList. Provides deduplication.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 7a84848b80..2c047504e9 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1999,7 +1999,7 @@ pub fn update(comp: *Compilation, main_progress_node: *std.Progress.Node) !void const is_hit = man.hit() catch |err| { const i = man.failed_file_index orelse return err; - const pp = man.files.items[i].prefixed_path orelse return err; + const pp = man.files.keys()[i].prefixed_path; const prefix = man.cache.prefixes()[pp.prefix]; return comp.setMiscFailure( .check_whole_cache, @@ -4147,7 +4147,7 @@ pub fn cImport(comp: *Compilation, c_src: []const u8, owner_mod: *Package.Module const prev_hash_state = man.hash.peekBin(); const actual_hit = hit: { _ = try man.hit(); - if (man.files.items.len == 0) { + if (man.files.entries.len == 0) { man.unhit(prev_hash_state, 0); break :hit false; } |
