diff options
author | 2022-12-06 21:04:38 -0800 | |
---|---|---|
committer | 2022-12-06 21:04:38 -0800 | |
commit | aa17f97d13c1b82261396daeb97ef9799d112060 (patch) | |
tree | 78e0e553d2a257d491117dd46a946bbdd18c2ec9 /src/string_immutable.zig | |
parent | e547efbf4ad6b4356e2a97f2238cc55426aaed38 (diff) | |
download | bun-aa17f97d13c1b82261396daeb97ef9799d112060.tar.gz bun-aa17f97d13c1b82261396daeb97ef9799d112060.tar.zst bun-aa17f97d13c1b82261396daeb97ef9799d112060.zip |
fix failing text decoder test
Diffstat (limited to '')
-rw-r--r-- | src/string_immutable.zig | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/string_immutable.zig b/src/string_immutable.zig index 38b11a5d5..2967869ff 100644 --- a/src/string_immutable.zig +++ b/src/string_immutable.zig @@ -980,8 +980,7 @@ pub fn toUTF16Alloc(allocator: std.mem.Allocator, bytes: []const u8, comptime fa const offset = @truncate(u32, validated.count); const trimmed = bun.simdutf.trim.utf8(bytes[offset..]); - if (trimmed.len == 0 and offset == 0) - return &[_]u16{}; + first_non_ascii = offset; if (trimmed.len == 0) break :use_simdutf; |