From 7fac327c1fd95c01c80d11a2f307b9aadc5f0a7f Mon Sep 17 00:00:00 2001 From: tucan9389 Date: Mon, 1 May 2023 16:29:20 +0900 Subject: [PATCH] Fix the "no-lonely-if" lint issue --- source/mlir.js | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/source/mlir.js b/source/mlir.js index 15c9e06c0b..2df005bf7b 100644 --- a/source/mlir.js +++ b/source/mlir.js @@ -245,23 +245,21 @@ mlir.Tokenizer = class { } else { break; } - } else { // opened - if (!this.currentChar) { + } else if (!this.currentChar) { + break; + } else if (this.currentChar === '>') { + result += this.currentChar; + this.advance(); + opened -= 1; + if (opened === 0) { break; - } else if (this.currentChar === '>') { - result += this.currentChar; - this.advance(); - opened -= 1; - if (opened === 0) { - break; - } - } else { - if (this.currentChar === '<') { - opened += 1; - } - result += this.currentChar; - this.advance(); } + } else { + if (this.currentChar === '<') { + opened += 1; + } + result += this.currentChar; + this.advance(); } }