mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
IDEA-253512: Fix SlowAbstractSetRemoveAllInspection
GitOrigin-RevId: 4629a9d2c9b72a7e4b9974bf7c4d93dea98fe7fe
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0f577fcb93
commit
99e697f12b
@@ -0,0 +1,13 @@
|
||||
// "Replace with 'removals.forEach(source::remove)'" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
void foo(Set<Integer> source, List<Integer> removals) {
|
||||
int setSize = source.size();
|
||||
int listSize = removals.size();
|
||||
if ((setSize == 100000 || setSize == 41) && listSize == 42) {
|
||||
removals.forEach(source::remove);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Replace with 'removals.forEach(source::remove)'" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
void foo(Set<Integer> source, List<Integer> removals) {
|
||||
int setSize = source.size();
|
||||
int listSize = removals.size();
|
||||
if ((setSize == 100000 || setSize == 41) && listSize == 42) {
|
||||
source.removeAll<caret>(removals);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// "Replace with 'removals.forEach(source::remove)'" "false"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
void foo(Set<Integer> source, List<Integer> removals) {
|
||||
if (source.size() > removals.size()) {
|
||||
source.removeAll<caret>(removals);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user