18 lines
251 B
Go
18 lines
251 B
Go
package peer
|
|
|
|
type dupList struct {
|
|
items [64]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) % 64
|
|
return false
|
|
}
|