idset.go: micro-optimise away redundant scan

This commit is contained in:
mappu 2016-07-26 09:36:31 +12:00 committed by GitHub
parent e8e45fe2e3
commit 32985f7904

View file

@ -55,11 +55,7 @@ func (s IDSet) Equals(other IDSet) bool {
} }
} }
for id := range other { // length + one-way comparison is sufficient implication of equality
if _, ok := s[id]; !ok {
return false
}
}
return true return true
} }