API Browser

Method

OrInsertWith

func OrInsertWith(factory: () -> V) -> V

Declaring type: MapEntry<K, V>
Namespace: System.Collections.Generic
Assembly: Raven.Core.dll
Source file: MapEntry.rvn

Calls the factory once only when absent, then inserts if still absent. A synchronous factory; may reenter the map. The current value if present after the factory; otherwise its inserted result. Callback insertion wins. A callback exception propagates before this helper writes; callback side effects are not rolled back.

Parameters

Name Type Description
factory () -> V

Return value

V