mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-21 05:51:25 +07:00
IDEA-161198 Migration from Stream API back to for loops
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// "Replace Stream API chain with loop" "true"
|
||||
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
public class Main {
|
||||
private static long check(int start, int stop, double v) {
|
||||
return IntStream.range(start, stop).mapToDouble(x -> 1.0 / x).filter(x -> x < v).cou<caret>nt();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(check(1, 100, 0.04));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user