Java: Use InlineUtil for removing redundant variable (IDEA-182669)

This commit is contained in:
Pavel Dolgov
2017-12-05 16:15:51 +03:00
parent fc25d52296
commit 6bc79aa7ed
3 changed files with 23 additions and 4 deletions
@@ -0,0 +1,8 @@
// "Move 'return' closer to computation of the value of 'n'" "true"
class T {
int[] f(int k) {
if (k == 1)
return new int[]{1};
return new int[]{-1};
}
}
@@ -0,0 +1,9 @@
// "Move 'return' closer to computation of the value of 'n'" "true"
class T {
int[] f(int k) {
int[] n = {-1};
if (k == 1)
n = new int[]{1};
<caret>return n;
}
}