From 253618aa24bfe2a670e5114c6681bda034d77b05 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Sun, 12 Dec 2021 15:19:23 -0800 Subject: [PATCH] condense continue calls --- src/lib.zig | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/lib.zig b/src/lib.zig index 0f29f2eee5360d139669251efef5030eee7e0eec..dad386e380471637fd532ede318ff7dae10f56a5 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -117,9 +117,7 @@ pub fn fileList(alloc: *std.mem.Allocator, dir: std.fs.Dir) ![]string { var walk = try dir.walk(alloc); defer walk.deinit(); while (try walk.next()) |entry| { - if (entry.kind != .File) { - continue; - } + if (entry.kind != .File) continue; try list.append(try alloc.dupe(u8, entry.path)); } return list.toOwnedSlice(); @@ -131,9 +129,7 @@ pub fn dirSize(alloc: *std.mem.Allocator, dir: std.fs.Dir) !usize { var walk = try dir.walk(alloc); defer walk.deinit(); while (try walk.next()) |entry| { - if (entry.kind != .File) { - continue; - } + if (entry.kind != .File) continue; res += try fileSize(dir, entry.path); } return res; -- 2.54.0