vppn/peer/duplist.go
2024-12-14 07:38:06 +01:00

20 lines
299 B
Go

package peer
const DUP_LIST_SIZE = 32
type dupList struct {
items [DUP_LIST_SIZE]uint64
index int
}
func (l *dupList) isDuplicate(in uint64) bool {
for _, i := range l.items {
if i == in {
return true
}
}
l.items[l.index] = in
l.index = (l.index + 1) % DUP_LIST_SIZE
return false
}