Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Method

OrInsert

func OrInsert(value: V) -> V

Declaring type: MapEntry<K, V>
Module: System.Collections
Assembly: System.Runtime.dll
Source file: MapEntry.rvn

Inserts the supplied value only when the key is absent.

Parameters

Name Type Description
value V The eagerly evaluated fallback value.

Return value

V

The existing or inserted value, not a reference to its storage slot.