aboutsummaryrefslogtreecommitdiff
path: root/src/string_immutable.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-26 22:14:29 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-26 22:14:29 -0800
commit819a63e3ec905d1f013ff9c7b7480ff649b78477 (patch)
tree43047083c1af909295a7fb4e9bb01ef422f781f8 /src/string_immutable.zig
parentc65c320b09c795cb27523ff61eb9f9d92663c8cd (diff)
downloadbun-819a63e3ec905d1f013ff9c7b7480ff649b78477.tar.gz
bun-819a63e3ec905d1f013ff9c7b7480ff649b78477.tar.zst
bun-819a63e3ec905d1f013ff9c7b7480ff649b78477.zip
Fix build issue
Diffstat (limited to '')
-rw-r--r--src/string_immutable.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/string_immutable.zig b/src/string_immutable.zig
index 545e807b4..c246e77cd 100644
--- a/src/string_immutable.zig
+++ b/src/string_immutable.zig
@@ -1085,8 +1085,8 @@ pub fn utf16Codepoint(comptime Type: type, input: Type) UTF16Replacement {
pub fn toUTF8AllocWithType(allocator: std.mem.Allocator, comptime Type: type, utf16: Type) ![]u8 {
if (bun.FeatureFlags.use_simdutf and comptime Type == []const u16) {
const length = bun.simdutf.length.utf8.from.utf16.le(utf16);
- const list = try std.ArrayList(u8).initCapacity(allocator, length);
- list.items.len += bun.simdutf.convert.utf16.to.utf8.le(utf16, list.items.ptr[0..length]);
+ var list = try allocator.alloc(u8, length);
+ _ = bun.simdutf.convert.utf16.to.utf8.le(utf16, list);
return list;
}