Skip to content

Commit 80e602c

Browse files
committed
Remove a String#indexOf call
1 parent 7199d5c commit 80e602c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/build.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ export const build = (statics) => {
9292
current = [current];
9393
mode = MODE_TAGNAME;
9494
}
95-
else if (mode !== MODE_TEXT && (idx = '\'">=/\t\n\r '.indexOf(char)) >= 0 && char.indexOf(quote) >= 0) {
95+
else if (mode !== MODE_TEXT && (char === quote || !quote) && (idx = '\'">=/\t\n\r '.indexOf(char)) >= 0) {
9696
if (idx < 2) {
97-
// char is a quote && (quote === char || quote is empty)
97+
// char === '"' || char === "'"
9898
quote = quote ? '' : char;
9999
}
100100
else if (idx === 2) {

0 commit comments

Comments
 (0)