aboutsummaryrefslogtreecommitdiff
path: root/src/string_immutable.zig
diff options
context:
space:
mode:
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