From c505030a6fa4594240ae5e344ea496efe7e51ede Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Sat, 3 Jul 2021 22:03:53 +0200 Subject: set: no extra slice required --- skate/set/set.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'skate/set') diff --git a/skate/set/set.go b/skate/set/set.go index b762cb8..7e06a1b 100644 --- a/skate/set/set.go +++ b/skate/set/set.go @@ -65,9 +65,9 @@ func (s Set) Contains(v string) bool { // Intersection returns a new set containing all elements found in both sets. func (s Set) Intersection(t Set) Set { u := New() - for _, v := range s.Slice() { - if t.Contains(v) { - u.Add(v) + for k := range s { + if t.Contains(k) { + u.Add(k) } } return u -- cgit v1.2.3