Skip to content

Commit d802fa4

Browse files
authored
Simplify stringLengthUTF8 more (#2113)
1 parent e08a264 commit d802fa4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3107,7 +3107,7 @@ function stringLengthUTF8(str: string): usize {
31073107
} else if (u <= 0x7FF) {
31083108
len += 2;
31093109
} else if (u >= 0xD800 && u <= 0xDFFF && i + 1 < k) {
3110-
u = 0x10000 + ((u & 0x3FF) << 10) | (str.charCodeAt(++i) & 0x3FF);
3110+
i++;
31113111
len += 4;
31123112
} else {
31133113
len += 3;

0 commit comments

Comments
 (0)