mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
StreamToLoop: fixed comparator parentheses wrapping; ParenthesesUtils changes reverted (unnecessary)
This commit is contained in:
+2
-2
@@ -3,11 +3,11 @@
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
private static Optional<String> max(Map<String, List<String>> dependencies, String fruits, Map<String, String> weights) {
|
||||
private static Optional<String> max(Map<String, List<String>> dependencies, String fruits, Map<String, Integer> weights) {
|
||||
boolean seen = false;
|
||||
String best = null;
|
||||
for (String s : dependencies.get(fruits)) {
|
||||
if (!seen || weights.get(s).compareTo(weights.get(best)) > 0) {
|
||||
if (!seen || weights.get(s) - weights.get(best) > 0) {
|
||||
seen = true;
|
||||
best = s;
|
||||
}
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
private static Optional<String> max(Map<String, List<String>> dependencies, String fruits, Map<String, String> weights) {
|
||||
return dependencies.get(fruits).stream().m<caret>ax((o1, o2) -> weights.get(o1).compareTo(weights.get(o2)));
|
||||
private static Optional<String> max(Map<String, List<String>> dependencies, String fruits, Map<String, Integer> weights) {
|
||||
return dependencies.get(fruits).stream().m<caret>ax((o1, o2) -> weights.get(o1)-weights.get(o2));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user