mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
StreamToLoop: support Optional unwrap if possible
This commit is contained in:
+1
-1
@@ -13,7 +13,7 @@ public class Main {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count == 0 ? OptionalDouble.empty() : OptionalDouble.of((double) sum / count);
|
||||
return count > 0 ? OptionalDouble.of((double) sum / count) : OptionalDouble.empty();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Reference in New Issue
Block a user