diff options
| author | Meghan Denny <hello@nektro.net> | 2025-02-09 20:21:31 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-10 04:21:31 +0000 |
| commit | 91424823724de866776c8b6a999ea45f1ca9d374 (patch) | |
| tree | 43c794431c7e5d83dc434117cca5884d8e01c672 /tools/process_headers.zig | |
| parent | 75df7e502c05e7e6a9b00a5a28854ae4a1aa8ea6 (diff) | |
| download | zig-91424823724de866776c8b6a999ea45f1ca9d374.tar.gz zig-91424823724de866776c8b6a999ea45f1ca9d374.zip | |
std.ArrayList: popOrNull() -> pop() [v2] (#22720)
Diffstat (limited to 'tools/process_headers.zig')
| -rw-r--r-- | tools/process_headers.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/process_headers.zig b/tools/process_headers.zig index 2c9d68d320..9d149a2eb5 100644 --- a/tools/process_headers.zig +++ b/tools/process_headers.zig @@ -192,7 +192,7 @@ pub fn main() !void { var dir_stack = std.ArrayList([]const u8).init(allocator); try dir_stack.append(target_include_dir); - while (dir_stack.popOrNull()) |full_dir_name| { + while (dir_stack.pop()) |full_dir_name| { var dir = std.fs.cwd().openDir(full_dir_name, .{ .iterate = true }) catch |err| switch (err) { error.FileNotFound => continue :search, error.AccessDenied => continue :search, @@ -273,14 +273,14 @@ pub fn main() !void { } } std.mem.sort(*Contents, contents_list.items, {}, Contents.hitCountLessThan); - const best_contents = contents_list.popOrNull().?; + const best_contents = contents_list.pop().?; if (best_contents.hit_count > 1) { // worth it to make it generic const full_path = try std.fs.path.join(allocator, &[_][]const u8{ out_dir, generic_name, path_kv.key_ptr.* }); try std.fs.cwd().makePath(std.fs.path.dirname(full_path).?); try std.fs.cwd().writeFile(.{ .sub_path = full_path, .data = best_contents.bytes }); best_contents.is_generic = true; - while (contents_list.popOrNull()) |contender| { + while (contents_list.pop()) |contender| { if (contender.hit_count > 1) { const this_missed_bytes = contender.hit_count * contender.bytes.len; missed_opportunity_bytes += this_missed_bytes; |
