Skip to content

Instantly share code, notes, and snippets.

@pacuna

pacuna/jtkzDkLI.go

Last active Jun 15, 2020
Embed
What would you like to do?
func (l *list) Contains(item []byte) bool {
var pred, curr *node
key, _ := hashstructure.Hash(item, nil)
pred = l.head
curr = pred.next
for curr.key < key {
pred = curr
curr = curr.next
}
return key == curr.key
}
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.