[Fix] Fixed MapOfMaps.computeIfAbsent()
This commit is contained in:
parent
b14b625626
commit
1cf15fe4e2
|
@ -145,7 +145,7 @@ public class MapOfLists<T, U> {
|
||||||
if ((u = getList(key)) == null) {
|
if ((u = getList(key)) == null) {
|
||||||
List<U> newValue;
|
List<U> newValue;
|
||||||
if ((newValue = mappingFunction.apply(key)) != null) {
|
if ((newValue = mappingFunction.apply(key)) != null) {
|
||||||
addList(key, newValue);
|
this.mapOfLists.put(key, newValue);
|
||||||
return newValue;
|
return newValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,7 +220,7 @@ public class MapOfMaps<T, U, V> {
|
||||||
if ((u = getMap(key)) == null) {
|
if ((u = getMap(key)) == null) {
|
||||||
Map<U, V> newValue;
|
Map<U, V> newValue;
|
||||||
if ((newValue = mappingFunction.apply(key)) != null) {
|
if ((newValue = mappingFunction.apply(key)) != null) {
|
||||||
addMap(key, newValue);
|
this.mapOfMaps.put(key, newValue);
|
||||||
return newValue;
|
return newValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,7 +163,7 @@ public class MapOfSets<T, U> {
|
||||||
if ((u = getSet(key)) == null) {
|
if ((u = getSet(key)) == null) {
|
||||||
Set<U> newValue;
|
Set<U> newValue;
|
||||||
if ((newValue = mappingFunction.apply(key)) != null) {
|
if ((newValue = mappingFunction.apply(key)) != null) {
|
||||||
addSet(key, newValue);
|
this.mapOfSets.put(key, newValue);
|
||||||
return newValue;
|
return newValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue