mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
IDEA-160802 Add inspection to optimize ...flatMap(Collection::stream).count() to ...mapToLong(Collection::size).sum();
New inspection along with Collection.stream().count() -> Collection.size() moved to separate file ReplaceInefficientStreamCountInspection
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
// "Replace Stream.flatMap().count() with Stream.mapToLong().sum()" "true"
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class Main {
|
||||
private String s;
|
||||
|
||||
public Main(List<List<String>> s) {
|
||||
long count = s.stream().mapToLong(Collection::size).sum();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user