1
0
Fork 0

Merge branch 'beta' into WebCrowlBeta

This commit is contained in:
Claudio Atzori 2024-04-22 11:40:24 +02:00
commit eb4692e4ee
1 changed files with 3 additions and 2 deletions

View File

@ -270,8 +270,9 @@ public class MergeUtils {
} }
HashMap<String, KeyValue> values = new HashMap<>(); HashMap<String, KeyValue> values = new HashMap<>();
left.forEach(kv -> values.put(kv.getKey(), kv));
right.forEach(kv -> values.putIfAbsent(kv.getKey(), kv)); Optional.ofNullable(left).ifPresent(l -> l.forEach(kv -> values.put(kv.getKey(), kv)));
Optional.ofNullable(right).ifPresent(r -> r.forEach(kv -> values.putIfAbsent(kv.getKey(), kv)));
return new ArrayList<>(values.values()); return new ArrayList<>(values.values());
} }