intmap

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Free is the key value of free fields
	Free = 0
	// Phi to scramble keys to prevent bad hashes
	Phi = 0x9E3779B9
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IntMap

type IntMap struct {
	// contains filtered or unexported fields
}

IntMap to store uint64->uint32 relations

func New

func New() IntMap

New instanciates an new IntMap

func (*IntMap) Delete

func (I *IntMap) Delete(key KeyType) (ValType, bool)

Delete removes a value from this map returns value,true or 0, false if the key wasnt in this map

func (*IntMap) Get

func (I *IntMap) Get(key KeyType) (ValType, bool)

Get retrieves an item from the intmap and returns value, true or 0, false if the item isn't in this map.

func (*IntMap) Put

func (I *IntMap) Put(key KeyType, val ValType)

Put adds an item to the int map

type KeyType

type KeyType = uint64

KeyType is the type of the keys for this map

type ValType

type ValType = uint64

ValType is the type of the values for this map

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL