mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
StreamToLoopInspection refactoring: strings replaced with actual PsiType's (as they are valid now); removed unnecessary code due to all PsiExpressions are also valid
This commit is contained in:
+3
-3
@@ -15,10 +15,10 @@ public class Main {
|
||||
boolean seen = false;
|
||||
int best = 0;
|
||||
for (Index index : set.asList()) {
|
||||
int i = index.asInteger();
|
||||
if (!seen || i < best) {
|
||||
int asInteger = index.asInteger();
|
||||
if (!seen || asInteger < best) {
|
||||
seen = true;
|
||||
best = i;
|
||||
best = asInteger;
|
||||
}
|
||||
}
|
||||
return seen ? OptionalInt.of(best) : OptionalInt.empty();
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@ public class Main {
|
||||
List<Integer> list = new ArrayList<>();
|
||||
for (int x : input) {
|
||||
if (x > 0) {
|
||||
Integer i = x * 2;
|
||||
list.add(i);
|
||||
Integer integer = x * 2;
|
||||
list.add(integer);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
|
||||
+4
-4
@@ -130,8 +130,8 @@ public class Main {
|
||||
private static List<String> testMethodRef(List<List<String>> list) {
|
||||
List<String> result = new ArrayList<>();
|
||||
for (List<String> strings : list) {
|
||||
for (String s : strings) {
|
||||
result.add(s);
|
||||
for (String string : strings) {
|
||||
result.add(string);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -140,8 +140,8 @@ public class Main {
|
||||
private static List<String> testMethodRef2(List<String[]> list) {
|
||||
List<String> result = new ArrayList<>();
|
||||
for (String[] strings : list) {
|
||||
for (String s : strings) {
|
||||
result.add(s);
|
||||
for (String t : strings) {
|
||||
result.add(t);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public class Main {
|
||||
public static boolean testIsPresent(List<List<String>> list) {
|
||||
for (List<String> strings : list) {
|
||||
if (strings != null) {
|
||||
for (String s : strings) {
|
||||
for (String string : strings) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user