From 557a1fdcaabd51899b9213175762ed9603409985 Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Sat, 27 Nov 2021 16:38:20 -0800 Subject: remote/addReachableTags: Remove guard before delete The membership check before attempting to `delete` from the `tags` map is unnecessary because the operation is a no-op if the item does not already exist in the map. --- remote.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/remote.go b/remote.go index d54693e..9e710a3 100644 --- a/remote.go +++ b/remote.go @@ -247,10 +247,7 @@ func (r *Remote) addReachableTags(localRefs []*plumbing.Reference, remoteRefs st // remove any that are already on the remote if err := remoteRefIter.ForEach(func(reference *plumbing.Reference) error { - if _, ok := tags[*reference]; ok { - delete(tags, *reference) - } - + delete(tags, *reference) return nil }); err != nil { return err -- cgit