diff options
author | 2021-04-29 14:03:01 -0700 | |
---|---|---|
committer | 2021-04-29 14:03:01 -0700 | |
commit | 75d2ee53b024b06fd9cde629d42fa8f921e02258 (patch) | |
tree | 03444a6de9677244fe6188d695cdcb4ee629925b /src/string_immutable.zig | |
parent | 1e9e42618b1923fdb65232129a1556c1b962a1a7 (diff) | |
download | bun-75d2ee53b024b06fd9cde629d42fa8f921e02258.tar.gz bun-75d2ee53b024b06fd9cde629d42fa8f921e02258.tar.zst bun-75d2ee53b024b06fd9cde629d42fa8f921e02258.zip |
wap
Former-commit-id: a32116476a168509154198369e22c2b76909347c
Diffstat (limited to 'src/string_immutable.zig')
-rw-r--r-- | src/string_immutable.zig | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/string_immutable.zig b/src/string_immutable.zig index d0dffd49e..9f1ebee87 100644 --- a/src/string_immutable.zig +++ b/src/string_immutable.zig @@ -89,6 +89,7 @@ pub fn eqlUtf16(comptime self: string, other: JavascriptString) bool { return std.mem.eql(u16, std.unicode.utf8ToUtf16LeStringLiteral(self), other); } +// Check utf16 string equals utf8 string without allocating extra memory pub fn utf16EqlString(text: []u16, str: string) bool { if (text.len > str.len) { // Strings can't be equal if UTF-16 encoding is longer than UTF-8 encoding |