This commit is contained in:
Clément Fournier committed 2021-05-28 16:12:11 +02:00
1 parent 6a23441b64
commit 77b57a7f3b
1 file changed
+3 -3
@@ -645,9 +645,9 @@ public final class CollectionUtil {
* merge them using the merge function, like {@link Map#merge(Object, Object, BiFunction)}.
*/
public static <K, V> void mergeMaps(Map<K, V> result, Map<K, V> other, BinaryOperator<V> mergeFun) {
for (K var : other.keySet()) {
V otherInfo = other.get(var); // non-null
result.merge(var, otherInfo, mergeFun);
for (K otherKey : other.keySet()) {
V otherInfo = other.get(otherKey); // non-null
result.merge(otherKey, otherInfo, mergeFun);
}
}
}