| ... | @@ -150,7 +150,7 @@ pub const Map = struct { | ... | @@ -150,7 +150,7 @@ pub const Map = struct { |
| 150 | } | 150 | } |
| 151 | | 151 | |
| 152 | pub fn contains(m: *const Map, key: []const u8) bool { | 152 | pub fn contains(m: *const Map, key: []const u8) bool { |
| 153 | return m.contains(key); | 153 | return m.array_hash_map.contains(key); |
| 154 | } | 154 | } |
| 155 | | 155 | |
| 156 | /// If there is an entry with a matching key, it is deleted from the hash | 156 | /// If there is an entry with a matching key, it is deleted from the hash |
| ... | @@ -579,10 +579,11 @@ pub const CreateBlockOptions = struct { | ... | @@ -579,10 +579,11 @@ pub const CreateBlockOptions = struct { |
| 579 | /// Creates a null-delimited environment variable block in the format expected | 579 | /// Creates a null-delimited environment variable block in the format expected |
| 580 | /// by POSIX, from a different one. | 580 | /// by POSIX, from a different one. |
| 581 | pub fn createBlock(existing: Environ, arena: Allocator, options: CreateBlockOptions) Allocator.Error![:null]?[*:0]u8 { | 581 | pub fn createBlock(existing: Environ, arena: Allocator, options: CreateBlockOptions) Allocator.Error![:null]?[*:0]u8 { |
| | 582 | const existing_block: [*:null]const ?[*:0]const u8 = @ptrCast(existing.block); |
| 582 | const existing_count, const contains_zig_progress = c: { | 583 | const existing_count, const contains_zig_progress = c: { |
| 583 | var count: usize = 0; | 584 | var count: usize = 0; |
| 584 | var contains = false; | 585 | var contains = false; |
| 585 | while (existing.block[count]) |line| : (count += 1) { | 586 | while (existing_block[count]) |line| : (count += 1) { |
| 586 | contains = contains or mem.eql(u8, mem.sliceTo(line, '='), "ZIG_PROGRESS"); | 587 | contains = contains or mem.eql(u8, mem.sliceTo(line, '='), "ZIG_PROGRESS"); |
| 587 | } | 588 | } |
| 588 | break :c .{ count, contains }; | 589 | break :c .{ count, contains }; |
| ... | @@ -617,7 +618,7 @@ pub fn createBlock(existing: Environ, arena: Allocator, options: CreateBlockOpti | ... | @@ -617,7 +618,7 @@ pub fn createBlock(existing: Environ, arena: Allocator, options: CreateBlockOpti |
| 617 | i += 1; | 618 | i += 1; |
| 618 | } | 619 | } |
| 619 | | 620 | |
| 620 | while (existing.block[existing_index]) |line| : (existing_index += 1) { | 621 | while (existing_block[existing_index]) |line| : (existing_index += 1) { |
| 621 | if (mem.eql(u8, mem.sliceTo(line, '='), "ZIG_PROGRESS")) switch (zig_progress_action) { | 622 | if (mem.eql(u8, mem.sliceTo(line, '='), "ZIG_PROGRESS")) switch (zig_progress_action) { |
| 622 | .add => unreachable, | 623 | .add => unreachable, |
| 623 | .delete => continue, | 624 | .delete => continue, |