Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
emirpasic committed Apr 12, 2022
1 parent e438e7b commit 74d4456
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions sets/hashset/hashset.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ func (set *Set) Intersection(another *Set) *Set {

// Iterate over smaller set (optimization)
if set.Size() <= another.Size() {
for item, _ := range set.items {
for item := range set.items {
if _, contains := another.items[item]; contains {
result.Add(item)
}
}
} else {
for item, _ := range another.items {
for item := range another.items {
if _, contains := set.items[item]; contains {
result.Add(item)
}
Expand All @@ -128,10 +128,10 @@ func (set *Set) Intersection(another *Set) *Set {
func (set *Set) Union(another *Set) *Set {
result := New()

for item, _ := range set.items {
for item := range set.items {
result.Add(item)
}
for item, _ := range another.items {
for item := range another.items {
result.Add(item)
}

Expand All @@ -144,7 +144,7 @@ func (set *Set) Union(another *Set) *Set {
func (set *Set) Difference(another *Set) *Set {
result := New()

for item, _ := range set.items {
for item := range set.items {
if _, contains := another.items[item]; !contains {
result.Add(item)
}
Expand Down
10 changes: 5 additions & 5 deletions sets/linkedhashset/linkedhashset.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ func (set *Set) Intersection(another *Set) *Set {

// Iterate over smaller set (optimization)
if set.Size() <= another.Size() {
for item, _ := range set.table {
for item := range set.table {
if _, contains := another.table[item]; contains {
result.Add(item)
}
}
} else {
for item, _ := range another.table {
for item := range another.table {
if _, contains := set.table[item]; contains {
result.Add(item)
}
Expand All @@ -147,10 +147,10 @@ func (set *Set) Intersection(another *Set) *Set {
func (set *Set) Union(another *Set) *Set {
result := New()

for item, _ := range set.table {
for item := range set.table {
result.Add(item)
}
for item, _ := range another.table {
for item := range another.table {
result.Add(item)
}

Expand All @@ -163,7 +163,7 @@ func (set *Set) Union(another *Set) *Set {
func (set *Set) Difference(another *Set) *Set {
result := New()

for item, _ := range set.table {
for item := range set.table {
if _, contains := another.table[item]; !contains {
result.Add(item)
}
Expand Down

0 comments on commit 74d4456

Please sign in to comment.