authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-12-12 15:19:23 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-12-12 15:19:23 -08:00
log253618aa24bfe2a670e5114c6681bda034d77b05
treec2f062fa14f61148e17690e5b899c7707655e748
parente7ede19e6f7cfb97574bf69b442cefa48181be12

condense continue calls


1 files changed, 2 insertions(+), 6 deletions(-)

src/lib.zig+2-6
......@@ -117,9 +117,7 @@ pub fn fileList(alloc: *std.mem.Allocator, dir: std.fs.Dir) ![]string {
117117 var walk = try dir.walk(alloc);
118118 defer walk.deinit();
119119 while (try walk.next()) |entry| {
120 if (entry.kind != .File) {
121 continue;
122 }
120 if (entry.kind != .File) continue;
123121 try list.append(try alloc.dupe(u8, entry.path));
124122 }
125123 return list.toOwnedSlice();
......@@ -131,9 +129,7 @@ pub fn dirSize(alloc: *std.mem.Allocator, dir: std.fs.Dir) !usize {
131129 var walk = try dir.walk(alloc);
132130 defer walk.deinit();
133131 while (try walk.next()) |entry| {
134 if (entry.kind != .File) {
135 continue;
136 }
132 if (entry.kind != .File) continue;
137133 res += try fileSize(dir, entry.path);
138134 }
139135 return res;