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