authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-22 18:21:52 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-22 18:21:52 -07:00
log57bd7b0d9500e18871d29244677e3a1d461cf216
tree951df7e9e48a0cc5a72c17df590b7e0e238fc6c6
parent9bf4680bdb381cebe368abce88a68a116cbc2a89

remove util.join


1 files changed, 1 insertions(+), 9 deletions(-)

src/util/funcs.zig+1-9
...@@ -101,15 +101,7 @@ pub fn repeat(s: string, times: i32) !string {...@@ -101,15 +101,7 @@ pub fn repeat(s: string, times: i32) !string {
101 while (i < times) : (i += 1) {101 while (i < times) : (i += 1) {
102 try list.append(s);102 try list.append(s);
103 }103 }
104 return join(list.items, "");104 return try concat(list.items);
105}
106
107pub fn join(xs: []string, delim: string) !string {
108 var res: string = "";
109 for (xs) |x, i| {
110 res = try std.fmt.allocPrint(gpa, "{s}{s}{s}", .{ res, x, if (i < xs.len - 1) delim else "" });
111 }
112 return res;
113}105}
114106
115pub fn concat(items: []string) !string {107pub fn concat(items: []string) !string {