From 32985f79043b1d8ce3b0517ab9e3eb9b6d523776 Mon Sep 17 00:00:00 2001 From: mappu Date: Tue, 26 Jul 2016 09:36:31 +1200 Subject: [PATCH] idset.go: micro-optimise away redundant scan --- src/restic/backend/idset.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/restic/backend/idset.go b/src/restic/backend/idset.go index de93f8754..12307219c 100644 --- a/src/restic/backend/idset.go +++ b/src/restic/backend/idset.go @@ -55,11 +55,7 @@ func (s IDSet) Equals(other IDSet) bool { } } - for id := range other { - if _, ok := s[id]; !ok { - return false - } - } + // length + one-way comparison is sufficient implication of equality return true }