Avoid null check on potentially nullable type parameter

This commit is contained in:
Christophe Coevoet 2022-09-03 00:17:39 +02:00
parent fec9a2aced
commit a705445f0d

View File

@ -455,7 +455,7 @@ extension MapExtension<K, V> on Map<K, V> {
/// [key] to the result.
V putOrMerge(K key, V value, V Function(V oldValue, V newValue) merge) =>
containsKey(key)
? this[key] = merge(this[key]!, value)
? this[key] = merge(this[key] as V, value)
: this[key] = value;
}