Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayMap ¶
An ArrayMap is an ordered map. It balances CPU cache-efficiency and insert/update/delete performance by storing entries in contiguous chunked arrays.
func New ¶
Create a new ArrayMap with a given chunk size. The chunk size is a tuning parameter to adjust the tradeoff between cache-efficiency and insert/delete performance.
func (*ArrayMap[K, V]) Delete ¶
Delete an entry from the array map. Returns false if the key does not exist in the map.
func (*ArrayMap[K, V]) First ¶
First returns the first element in the array map. If the map is empty, it returns false in the bool flag.
func (*ArrayMap[K, V]) Get ¶
Get a value with a given key from the ArrayMap. If the key does not exist in the map, it returns the empty entry and false.
func (*ArrayMap[K, V]) Insert ¶
func (m *ArrayMap[K, V]) Insert(k K, v V)
Insert or update an entry in the ArrayMap.