Skip to content

Commit 7fac327

Browse files
committed
Fix the "no-lonely-if" lint issue
1 parent e068556 commit 7fac327

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

source/mlir.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -245,23 +245,21 @@ mlir.Tokenizer = class {
245245
} else {
246246
break;
247247
}
248-
} else { // opened
249-
if (!this.currentChar) {
248+
} else if (!this.currentChar) {
249+
break;
250+
} else if (this.currentChar === '>') {
251+
result += this.currentChar;
252+
this.advance();
253+
opened -= 1;
254+
if (opened === 0) {
250255
break;
251-
} else if (this.currentChar === '>') {
252-
result += this.currentChar;
253-
this.advance();
254-
opened -= 1;
255-
if (opened === 0) {
256-
break;
257-
}
258-
} else {
259-
if (this.currentChar === '<') {
260-
opened += 1;
261-
}
262-
result += this.currentChar;
263-
this.advance();
264256
}
257+
} else {
258+
if (this.currentChar === '<') {
259+
opened += 1;
260+
}
261+
result += this.currentChar;
262+
this.advance();
265263
}
266264
}
267265

0 commit comments

Comments
 (0)