| ... | @@ -106,11 +106,7 @@ pub fn join(xs: [][]const u8, delim: []const u8) ![]const u8 { | ... | @@ -106,11 +106,7 @@ pub fn join(xs: [][]const u8, delim: []const u8) ![]const u8 { |
| 106 | } | 106 | } |
| 107 | | 107 | |
| 108 | pub fn concat(items: [][]const u8) ![]const u8 { | 108 | pub fn concat(items: [][]const u8) ![]const u8 { |
| 109 | var buf: []const u8 = ""; | 109 | return std.mem.join(gpa, "", items); |
| 110 | for (items) |x| { | | |
| 111 | buf = try std.fmt.allocPrint(gpa, "{s}{s}", .{ buf, x }); | | |
| 112 | } | | |
| 113 | return buf; | | |
| 114 | } | 110 | } |
| 115 | | 111 | |
| 116 | pub fn print_all(w: std.fs.File.Writer, items: anytype, ln: bool) !void { | 112 | pub fn print_all(w: std.fs.File.Writer, items: anytype, ln: bool) !void { |