From 63c9315b24910095b76c7a01c3129c3500a2a5ad Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Sat, 15 Oct 2022 21:03:40 -0700 Subject: Add a helper for InlineBlob from two arrays --- src/bun.js/api/server.zig | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/bun.js/api/server.zig') diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig index 809b35d32..f3b9425ef 100644 --- a/src/bun.js/api/server.zig +++ b/src/bun.js/api/server.zig @@ -2134,10 +2134,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp break :getter; } - req.body = .{ .InlineBlob = JSC.WebCore.InlineBlob.init(bytes.items) }; - var to_copy: []u8 = req.body.InlineBlob.bytes[bytes.items.len..]; - @memcpy(to_copy.ptr, chunk.ptr, chunk.len); - req.body.InlineBlob.len += @truncate(JSC.WebCore.InlineBlob.IntSize, chunk.len); + req.body = .{ .InlineBlob = JSC.WebCore.InlineBlob.concat(bytes.items, chunk) }; this.request_body_buf.clearAndFree(this.allocator); } else { bytes.ensureTotalCapacityPrecise(this.allocator, total) catch |err| { -- cgit v1.2.3