diff options
| author | Martin Wickham <spexguy070@gmail.com> | 2021-06-03 15:39:26 -0500 |
|---|---|---|
| committer | Martin Wickham <spexguy070@gmail.com> | 2021-06-03 17:02:16 -0500 |
| commit | fc9430f56798a53f9393a697f4ccd6bf9981b970 (patch) | |
| tree | 69a1a3b359e970349f9466f85a370918d78b7217 /src/main.zig | |
| parent | 87dae0ce98fde1957a9290c22866b3101ce419d8 (diff) | |
| download | zig-fc9430f56798a53f9393a697f4ccd6bf9981b970.tar.gz zig-fc9430f56798a53f9393a697f4ccd6bf9981b970.zip | |
Breaking hash map changes for 0.8.0
- hash/eql functions moved into a Context object
- *Context functions pass an explicit context
- *Adapted functions pass specialized keys and contexts
- new getPtr() function returns a pointer to value
- remove functions renamed to fetchRemove
- new remove functions return bool
- removeAssertDiscard deleted, use assert(remove(...)) instead
- Keys and values are stored in separate arrays
- Entry is now {*K, *V}, the new KV is {K, V}
- BufSet/BufMap functions renamed to match other set/map types
- fixed iterating-while-modifying bug in src/link/C.zig
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main.zig b/src/main.zig index 2017f17789..9245f5fd8a 100644 --- a/src/main.zig +++ b/src/main.zig @@ -180,7 +180,7 @@ pub fn mainArgs(gpa: *Allocator, arena: *Allocator, args: []const []const u8) !v "in order to determine where libc is installed. However the system C " ++ "compiler is `zig cc`, so no libc installation was found.", .{}); } - try env_map.set(inf_loop_env_key, "1"); + try env_map.put(inf_loop_env_key, "1"); // Some programs such as CMake will strip the `cc` and subsequent args from the // CC environment variable. We detect and support this scenario here because of @@ -2310,9 +2310,9 @@ fn updateModule(gpa: *Allocator, comp: *Compilation, hook: AfterUpdateHook) !voi fn freePkgTree(gpa: *Allocator, pkg: *Package, free_parent: bool) void { { - var it = pkg.table.iterator(); - while (it.next()) |kv| { - freePkgTree(gpa, kv.value, true); + var it = pkg.table.valueIterator(); + while (it.next()) |value| { + freePkgTree(gpa, value.*, true); } } if (free_parent) { @@ -3895,7 +3895,7 @@ pub fn cmdChangelist( var it = inst_map.iterator(); while (it.next()) |entry| { try stdout.print(" %{d} => %{d}\n", .{ - entry.key, entry.value, + entry.key_ptr.*, entry.value_ptr.*, }); } } @@ -3904,7 +3904,7 @@ pub fn cmdChangelist( var it = extra_map.iterator(); while (it.next()) |entry| { try stdout.print(" {d} => {d}\n", .{ - entry.key, entry.value, + entry.key_ptr.*, entry.value_ptr.*, }); } } |
