aboutsummaryrefslogtreecommitdiffstats
path: root/skate/set
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-07-03 22:03:53 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-07-03 22:03:53 +0200
commitc505030a6fa4594240ae5e344ea496efe7e51ede (patch)
tree35d7967fb7a68b83a27283f60199952d4e1163df /skate/set
parent00dac1ff90b1f0797fe71d2edd787f731c51bfb2 (diff)
downloadrefcat-c505030a6fa4594240ae5e344ea496efe7e51ede.tar.gz
refcat-c505030a6fa4594240ae5e344ea496efe7e51ede.zip
set: no extra slice required
Diffstat (limited to 'skate/set')
-rw-r--r--skate/set/set.go6
1 files changed, 3 insertions, 3 deletions
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