Scoop API

scoop:scoop.std:0.1.0

getOrPut

function getOrPut

source · line 113
public
public fun <K, V> MutableMap<K, V>.getOrPut(key: K, defaultValue: () -> V): V

Extension receiver: MutableMap<K, V>

Returns an existing value, or computes, inserts, and returns one for an absent key. This operation is not a concurrent-map primitive.