Hash_Map module

find

procedureextensionsince 0.23.0Source

A pointer to the key's value, or null if it is missing. The pointer stays valid until the map is next rebuilt by an insert or entry.

Example↗
Hash_Map :: #import "Extensions/Hash_Map";

map: Hash_Map.Map(string, int);
defer Hash_Map.deinit(*map);

Hash_Map.insert(*map, "hits", 1);
hits := Hash_Map.find(*map, "hits");
hits.* += 1;
assert(Hash_Map.get(*map, "hits") == 2);
assert(Hash_Map.find(*map, "misses") == null);
find :: (map: *Map, key: map.Key) -> *map.Value

Parameters

map: *Map
key: map.Key

Returns

*map.Value

See also