Documentation ¶
Index ¶
- Constants
- Variables
- type HashMap
- func (h *HashMap[K, V]) Delete(key K)
- func (h *HashMap[K, V]) Get(key K) (v V)
- func (h *HashMap[K, V]) GetWithBool(key K) (v V, ok bool)
- func (h *HashMap[K, V]) Init()
- func (h *HashMap[K, V]) Len() int
- func (h *HashMap[K, V]) Range(pr func(key K, val V) bool)
- func (h *HashMap[K, V]) Remove(key K) (err error)
- func (h *HashMap[K, V]) Resize(size uint64) error
- func (h *HashMap[K, V]) Set(k K, v V)
- func (h *HashMap[K, V]) SetWithPrev(k K, v V) (prev V, replaced bool)
- func (h *HashMap[K, V]) ShrinkToFit() error
- type Option
Constants ¶
View Source
const ( HT_INITIAL_EXP = 2 HT_INITIAL_SIZE = (1 << (HT_INITIAL_EXP)) )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type HashMap ¶
type HashMap[K comparable, V any] struct { // contains filtered or unexported fields }
hash 表头
func NewWithOpt ¶
func NewWithOpt[K comparable, V any](opts ...Option) *HashMap[K, V]
初始化一个hashtable并且可以设置值
func (*HashMap[K, V]) GetWithBool ¶ added in v0.0.6
获取
func (*HashMap[K, V]) SetWithPrev ¶
设置
Click to show internal directories.
Click to hide internal directories.