mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-10 01:09:46 +07:00
9 lines
212 B
Java
9 lines
212 B
Java
// "Collapse loop with stream 'sum()'" "true-preview"
|
|
|
|
import java.util.Arrays;
|
|
|
|
public class Main {
|
|
public void test(double[] list) {
|
|
int sum = Arrays.stream(list).mapToInt(x -> (int) (x * x)).sum();
|
|
}
|
|
} |