mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
IDEA-161198 Migration from Stream API back to for loops
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// "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) {
|
||||
long count = 0;
|
||||
for (int x = start; x < stop; x++) {
|
||||
double x1 = 1.0 / x;
|
||||
if (x1 < v) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(check(1, 100, 0.04));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user