applyToKey

inline fun <K, V> MutableMap<in K, V>.applyToKey(key: K, transform: (currentValue: V?) -> V): V

Applies the transformation to the value corresponding to the given key or null instead if it's not present.

Return

result of the transformation

Parameters

key

key to check.

transform

transformation to apply.