Skip to content

Instantly share code, notes, and snippets.

@pacuna

pacuna/dV3PJfZP.go

Last active Jun 15, 2020
Embed
What would you like to do?
type node struct {
item []byte
key uint64
next *node
}
func newNode(item []byte) *node {
key, _ := hashstructure.Hash(item, nil)
return &node{
item: item,
key: key,
}
}
type list struct {
head *node
size int
}
func New() *list {
head := &node{
key: 0,
}
tail := &node{
key: math.MaxUint64,
}
head.next = tail
return &list{
head: head,
size: 0,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.