Skip to content

Commit e8f6fa5

Browse files
authored
Merge pull request #2006 from chenqimiao/pr-GenericTokenParser
Minor optimization for GenericTokenParser
2 parents 537b980 + 09f2d08 commit e8f6fa5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/apache/ibatis/parsing/GenericTokenParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public String parse(String text) {
4343
int offset = 0;
4444
final StringBuilder builder = new StringBuilder();
4545
StringBuilder expression = null;
46-
while (start > -1) {
46+
do {
4747
if (start > 0 && src[start - 1] == '\\') {
4848
// this open token is escaped. remove the backslash and continue.
4949
builder.append(src, offset, start - offset - 1).append(openToken);
@@ -79,7 +79,7 @@ public String parse(String text) {
7979
}
8080
}
8181
start = text.indexOf(openToken, offset);
82-
}
82+
} while (start > -1);
8383
if (offset < src.length) {
8484
builder.append(src, offset, src.length - offset);
8585
}

0 commit comments

Comments
 (0)