[Fix] Fixed MapOfMaps.computeIfAbsent()

This commit is contained in:
Robert von Burg 2020-10-05 14:11:45 +02:00
parent b14b625626
commit 1cf15fe4e2
3 changed files with 3 additions and 3 deletions

View File

@ -145,7 +145,7 @@ public class MapOfLists<T, U> {
if ((u = getList(key)) == null) {
List<U> newValue;
if ((newValue = mappingFunction.apply(key)) != null) {
addList(key, newValue);
this.mapOfLists.put(key, newValue);
return newValue;
}
}

View File

@ -220,7 +220,7 @@ public class MapOfMaps<T, U, V> {
if ((u = getMap(key)) == null) {
Map<U, V> newValue;
if ((newValue = mappingFunction.apply(key)) != null) {
addMap(key, newValue);
this.mapOfMaps.put(key, newValue);
return newValue;
}
}

View File

@ -163,7 +163,7 @@ public class MapOfSets<T, U> {
if ((u = getSet(key)) == null) {
Set<U> newValue;
if ((newValue = mappingFunction.apply(key)) != null) {
addSet(key, newValue);
this.mapOfSets.put(key, newValue);
return newValue;
}
}