mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Make code in UnnecessaryUnicodeEscapeInspection shorter
The keyword "while" at the beginning of a line usually starts a while loop instead of ending a do-while loop. To avoid further confusion, replace the do-while loop with a typical while-loop.
This commit is contained in:
committed by
Bas Leijdekkers
parent
32378af5a5
commit
d6bb3f8c80
+3
-7
@@ -131,14 +131,10 @@ public class UnnecessaryUnicodeEscapeInspection extends BaseInspection {
|
||||
if (!isEscape) {
|
||||
continue;
|
||||
}
|
||||
int nextChar = i;
|
||||
do {
|
||||
nextChar++;
|
||||
if (nextChar >= length) {
|
||||
break;
|
||||
}
|
||||
int nextChar = i + 1;
|
||||
while (nextChar < length && text.charAt(nextChar) == 'u') {
|
||||
nextChar++; // \\uuuu0061 is a legal Unicode escape
|
||||
}
|
||||
while (text.charAt(nextChar) == 'u'); // \\uuuu0061 is a legal unicode escape
|
||||
if (nextChar == i + 1 || nextChar + 3 >= length) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user