debox
debox copied to clipboard
add a Map.put(key: A, value: B): Option[B]
In analogy with mutable.Map. Otherwise one has to search twice, with
val old = m.get(k)
m.update(k, v)
old
which, admittedly, is what MapLike
does but isn't efficient.
I can PR such, if you want.
@performantdata Sounds good. Another one that I think would be nice to have would be some variant of getOrElseUpdate
.
So you want that I write it?
Feel free to write it if you want. Otherwise, I'll get to it eventually (but maybe not super soon).