From 9f5ee6bcc392b886fb574f2b04f8663f6c02f125 Mon Sep 17 00:00:00 2001 From: David Gonzalez Martin Date: Wed, 10 Apr 2024 10:39:17 -0600 Subject: [PATCH] Delete concatenate bytes --- lib/std/std.nat | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib/std/std.nat b/lib/std/std.nat index d63be79..34a9267 100644 --- a/lib/std/std.nat +++ b/lib/std/std.nat @@ -156,22 +156,6 @@ const copy_bytes = fn(destination: []u8, source: []const u8) void { } } -const concatenate_bytes = fn(allocator: &Allocator, slices: []const []const u8) Allocator.Error![]u8 { - var total_byte_count: usize = 0; - for (slices) |slice| { - total_byte_count += slice.length; - } - - const bytes = try allocator.allocate(total_byte_count, 1); - var offset: usize = 0; - for (slice) |slice| { - copy_bytes(bytes[offset..][0..slice.length], slice); - offset += slice.length; - } - - return bytes; -} - const Target = struct { cpu: builtin.Cpu, os: builtin.Os,