computeOn

inline fun <K, V, R> Map<in K, V>.computeOn(key: K, compute: (V?) -> R): R

Computes the given lambda compute on value corresponding to the provided key or null if the key is not present.

Return

result of the computation of the lambda.

Parameters

key

key which corresponding value will be used if it's present.

compute

lambda that is computed on the received value.