MCPcopy Create free account
hub / github.com/mozilla/rhino / compute

Method compute

rhino/src/main/java/org/mozilla/javascript/SlotMap.java:67–67  ·  view source on GitHub ↗

Replace the value of key with the slot computed by the "compute" method. If "compute" throws an exception, make no change. If "compute" returns null, remove the mapping, otherwise, replace any existing mapping with the result of "compute", and create a new mapping if none exists. This is equivalent

(
            SlotMapOwner<T> owner, Object key, int index, SlotComputer<S, T> compute)

Source from the content-addressed store, hash-verified

65 * use of multiple Slot subclasses, this function is templatized.
66 */
67 default <S extends Slot<T>> S compute(
68 SlotMapOwner<T> owner, Object key, int index, SlotComputer<S, T> compute) {
69 try (var mutableMap = owner.startCompoundOp(true)) {
70 return mutableMap.compute(owner, mutableMap, key, index, compute);

Callers 15

crudOneStringMethod · 0.65
crudOneIndexMethod · 0.65
computeReplaceSlotMethod · 0.65
computeCreateNewSlotMethod · 0.65
computeRemoveSlotMethod · 0.65
manyKeysAndIndicesMethod · 0.65
computeWithLockMethod · 0.65
computeMethod · 0.65

Calls

no outgoing calls