Skip to content

Commit

Permalink
runtime: fix noSubstr
Browse files Browse the repository at this point in the history
Signed-off-by: Sora Morimoto <[email protected]>
  • Loading branch information
smorimoto committed Sep 20, 2024
1 parent e7d1748 commit b77e68b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 1 addition & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"noSwitchDeclarations": "off"
},
"nursery": {
"noSubstr": "error",
"noUselessEscapeInRegex": "error"
},
"security": {
Expand Down
4 changes: 0 additions & 4 deletions runtime/mlBytes.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ function caml_utf8_of_utf16(s) {
if (c < 0x80) {
for (var j = i + 1; j < l && (c = s.charCodeAt(j)) < 0x80; j++);
if (j - i > 512) {
t.substr(0, 1);
b += t;
t = "";
b += s.slice(i, j);
Expand Down Expand Up @@ -125,7 +124,6 @@ function caml_utf8_of_utf16(s) {
);
}
if (t.length > 1024) {
t.substr(0, 1);
b += t;
t = "";
}
Expand All @@ -140,7 +138,6 @@ function caml_utf16_of_utf8(s) {
if (c1 < 0x80) {
for (var j = i + 1; j < l && (c1 = s.charCodeAt(j)) < 0x80; j++);
if (j - i > 512) {
t.substr(0, 1);
b += t;
t = "";
b += s.slice(i, j);
Expand Down Expand Up @@ -179,7 +176,6 @@ function caml_utf16_of_utf8(s) {
t += String.fromCharCode(0xd7c0 + (v >> 10), 0xdc00 + (v & 0x3ff));
else t += String.fromCharCode(v);
if (t.length > 1024) {
t.substr(0, 1);
b += t;
t = "";
}
Expand Down

0 comments on commit b77e68b

Please sign in to comment.