Documentation
¶
Index ¶
- type Funcs
- type Helper
- type Hmap
- func (h *Hmap[K, V, H]) Clear()
- func (h *Hmap[K, V, H]) Copy() *Hmap[K, V, H]
- func (h *Hmap[K, V, H]) Del(key K) V
- func (h *Hmap[K, V, H]) Get(key K) V
- func (h *Hmap[K, V, H]) Get2(key K) (k K, v V, ok bool)
- func (h *Hmap[K, V, H]) GetPut(key K, val V) (K, V, bool)
- func (h *Hmap[K, V, H]) Has(key K) bool
- func (h *Hmap[K, V, H]) Iter() func() (K, V)
- func (h *Hmap[K, V, H]) Put(key K, val V)
- func (h *Hmap[K, V, H]) Size() int
- type Key
- type Meth
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Funcs ¶
type Funcs[K any] struct { // contains filtered or unexported fields }
Funcs is a helper that is configured with hash and equals functions. This allows using closures which allows context.
type Hmap ¶
Hmap implements a hash map for SuObject based on: https://github.com/skarupke/flat_hash_map bytell_hash_map Its zero value is a valid empty table. NOTE: Hmap is not thread safe.
func NewHmapFuncs ¶
func (*Hmap[K, V, H]) Clear ¶
func (h *Hmap[K, V, H]) Clear()
Clear deletes the data but keeps the capacity
func (*Hmap[K, V, H]) Del ¶
func (h *Hmap[K, V, H]) Del(key K) V
Del deletes a key and returns its old value, or nil if it didn't exist
func (*Hmap[K, V, H]) Get ¶
func (h *Hmap[K, V, H]) Get(key K) V
Get returns the value for the key or nil if not found
func (*Hmap[K, V, H]) GetPut ¶
GetPut adds an entry if it doesn't exist, returns true if it already existed. Useful to avoid separate check and add.
Click to show internal directories.
Click to hide internal directories.