DoxigAlpha

getOrPutAssumeCapacity

If there is an existing item with key, then the result Entry pointer points to it, and found_existing is true. Otherwise, puts a new item with undefined value, and the Entry pointer points to it. Caller should then initialize the value (but not the key). If a new entry needs to be stored, this function asserts there is enough capacity to store it.

Function parameters

Parameters

#
self:*Self
key:K

Type definitions in this namespace

Types

#

An `ArrayHashMap` with default hash and equal functions.

Functions

#
AutoArrayHashMap
An `ArrayHashMap` with default hash and equal functions.
AutoArrayHashMapUnmanaged
An `ArrayHashMapUnmanaged` with default hash and equal functions.
StringArrayHashMap
An `ArrayHashMap` with strings as keys.
StringArrayHashMapUnmanaged
An `ArrayHashMapUnmanaged` with strings as keys.
ArrayHashMap
Deprecated in favor of `ArrayHashMapWithAllocator` (no code changes needed)
ArrayHashMapWithAllocator
A hash table of keys and values, each stored sequentially.
ArrayHashMapUnmanaged
A hash table of keys and values, each stored sequentially.

Source

Implementation

#
pub fn getOrPutAssumeCapacity(self: *Self, key: K) GetOrPutResult {
    if (@sizeOf(Context) != 0)
        @compileError("Cannot infer context " ++ @typeName(Context) ++ ", call getOrPutAssumeCapacityContext instead.");
    return self.getOrPutAssumeCapacityContext(key, undefined);
}