Java: Don't fold the whole extracted expression - simplified the fix (IDEA-195927)

This commit is contained in:
Pavel Dolgov
2018-07-23 16:44:10 +03:00
parent 03ff6a98a6
commit 3e7bc47796
4 changed files with 48 additions and 5 deletions
@@ -0,0 +1,19 @@
class C {
int x;
int b(boolean[] b, C[] c, int n) {
int i = n;
while (i >= 0 && <selection>(b[i] || c[n].x == c[i].x)</selection>) {
i--;
}
return i;
}
int a(boolean[] b, C[] c, int n) {
int i = n;
while (i < c.length && (b[i] || c[n].x == c[i].x)) {
i++;
}
return i;
}
}