map Bin At Hash Replacing Level Can Destroy
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.
key Hash
The already computed hash of that key, to avoid rehashing while traversing the tree structure.
not Found Value
What to pass the transformer if the key was not found.
my Level
The level of the map bin.
can Destroy
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.