authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-29 04:03:06 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-29 04:03:06 -08:00
log07a3c632b5c651f4c1d1a7147e3f0e17c99b6804
treea0e317f7303c106d02966ecea18c5a084833817d
parent5ef889d8843b678cb40574e111e03040c095c7c6

change util.list_contains to take an array instead of list


2 files changed, 5 insertions(+), 5 deletions(-)

src/cmd_fetch.zig+3-3
......@@ -179,8 +179,8 @@ fn print_deps(w: fs.File.Writer, dir: []const u8, m: u.Module, tabs: i32) anyerr
179179 try w.print("{}", .{try u.concat(&[_][]const u8{r,"}"})});
180180}
181181
182 if (u.list_contains(list, mod.clean_path)) {
183182fn print_incl_dirs_to(w: fs.File.Writer, mod: u.Module, list: *std.ArrayList([]const u8), local: bool) anyerror!void {
183 if (u.list_contains(list.items, mod.clean_path)) {
184184 return;
185185 }
186186 try list.append(mod.clean_path);
......@@ -196,8 +196,8 @@ fn print_incl_dirs_to(w: fs.File.Writer, mod: u.Module, list: *std.ArrayList([]c
196196 }
197197}
198198
199 if (u.list_contains(list, mod.clean_path)) {
200199fn print_csrc_dirs_to(w: fs.File.Writer, mod: u.Module, list: *std.ArrayList([]const u8), local: bool) anyerror!void {
200 if (u.list_contains(list.items, mod.clean_path)) {
201201 return;
202202 }
203203 try list.append(mod.clean_path);
......@@ -213,8 +213,8 @@ fn print_csrc_dirs_to(w: fs.File.Writer, mod: u.Module, list: *std.ArrayList([]c
213213 }
214214}
215215
216 if (u.list_contains(list, mod.clean_path)) {
217216fn print_csrc_flags_to(w: fs.File.Writer, mod: u.Module, list: *std.ArrayList([]const u8), local: bool) anyerror!void {
217 if (u.list_contains(list.items, mod.clean_path)) {
218218 return;
219219 }
220220 try list.append(mod.clean_path);
src/util/funcs.zig+2-2
......@@ -107,8 +107,8 @@ pub fn print_all(w: std.fs.File.Writer, items: anytype, ln: bool) !void {
107107 }
108108}
109109
110pub fn list_contains(haystack: *std.ArrayList([]const u8), needle: []const u8) bool {
111 for (haystack.items) |item| {
110pub fn list_contains(haystack: [][]const u8, needle: []const u8) bool {
111 for (haystack) |item| {
112112 if (std.mem.eql(u8, item, needle)) {
113113 return true;
114114 }