mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 19:08:50 +00:00
This commit is contained in:
@@ -1066,9 +1066,10 @@ pub fn toUTF16Alloc(allocator: std.mem.Allocator, bytes: []const u8, comptime fa
|
||||
var first_non_ascii: ?u32 = null;
|
||||
var output_: ?std.ArrayList(u16) = null;
|
||||
|
||||
if (bun.FeatureFlags.use_simdutf) {
|
||||
if (bytes.len == 0)
|
||||
return &[_]u16{};
|
||||
if (bun.FeatureFlags.use_simdutf and
|
||||
// workaround https://github.com/simdutf/simdutf/issues/213
|
||||
bytes.len > 4)
|
||||
{
|
||||
use_simdutf: {
|
||||
if (bun.simdutf.validate.ascii(bytes))
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user