mapBinAtHashReplacingLevelCanDestroy

fun A_MapBin.mapBinAtHashReplacingLevelCanDestroy(    key: AvailObject,     keyHash: Int,     notFoundValue: AvailObject,     myLevel: Int,     canDestroy: Boolean,     transformer: (AvailObject, AvailObject) -> A_BasicObject): A_MapBin

Transform an element of this map bin. If there is an entry for the key, use the corresponding value as the second argument to the transformer, otherwise pass the notFoundValue. Write the result back to the bin, potentially recycling it if canDestroy is true.

Return

A replacement bin.

Parameters

key

The key to look up.

keyHash

The already computed hash of that key, to avoid rehashing while traversing the tree structure.

notFoundValue

What to pass the transformer if the key was not found.

myLevel

The level of the map bin.

canDestroy

Whether the original bin can be destroyed, if it's also mutable.

transformer

A binary operator that takes the key and its value, or the notFoundValue, and produces a replacement value to associate with the key.