diff options
author | 2023-02-10 15:12:14 -0600 | |
---|---|---|
committer | 2023-02-10 13:12:14 -0800 | |
commit | b1aac9ff6d0e978d02e823149a31d01444c36373 (patch) | |
tree | a210c0a681102ed46395cf86afcb6c9fe7c23257 | |
parent | ed2e0e1617d3a3200800f9166d400913cc2484bd (diff) | |
download | bun-b1aac9ff6d0e978d02e823149a31d01444c36373.tar.gz bun-b1aac9ff6d0e978d02e823149a31d01444c36373.tar.zst bun-b1aac9ff6d0e978d02e823149a31d01444c36373.zip |
fix(string_immutable): fix `toUTF16Alloc` for bindgen w/ `use_simdutf = false` (#2042)
-rw-r--r-- | src/string_immutable.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/string_immutable.zig b/src/string_immutable.zig index 3e3880331..079817362 100644 --- a/src/string_immutable.zig +++ b/src/string_immutable.zig @@ -1082,7 +1082,8 @@ pub fn toUTF16Alloc(allocator: std.mem.Allocator, bytes: []const u8, comptime fa }, else => return out, } - }; + } else null; + var output = output_ orelse fallback: { var list = try std.ArrayList(u16).initCapacity(allocator, i + 2); list.items.len = i; |