aboutsummaryrefslogtreecommitdiff
path: root/src/string_immutable.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-04-29 14:03:01 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-04-29 14:03:01 -0700
commit75d2ee53b024b06fd9cde629d42fa8f921e02258 (patch)
tree03444a6de9677244fe6188d695cdcb4ee629925b /src/string_immutable.zig
parent1e9e42618b1923fdb65232129a1556c1b962a1a7 (diff)
downloadbun-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.zig1
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