Skip to content

Commit

Permalink
Fix Diff slice bounds out of range (#170)
Browse files Browse the repository at this point in the history
Fixes #169
  • Loading branch information
istudko authored Apr 6, 2021
1 parent a3a59d9 commit 1d6cd85
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions functions/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func (ss SliceType) Diff(against SliceType) (added, removed SliceType) {
if s.Equals(element) {
ss2 = append(ss2[:i], ss2[i+1:]...)
found = true
break
}
}

Expand Down
1 change: 1 addition & 0 deletions pie/carpointers_pie.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func (ss carPointers) Diff(against carPointers) (added, removed carPointers) {
if s.Equals(element) {
ss2 = append(ss2[:i], ss2[i+1:]...)
found = true
break
}
}

Expand Down
1 change: 1 addition & 0 deletions pie/cars_pie.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func (ss cars) Diff(against cars) (added, removed cars) {
if s == element {
ss2 = append(ss2[:i], ss2[i+1:]...)
found = true
break
}
}

Expand Down
1 change: 1 addition & 0 deletions pie/float64s_pie.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func (ss Float64s) Diff(against Float64s) (added, removed Float64s) {
if s == element {
ss2 = append(ss2[:i], ss2[i+1:]...)
found = true
break
}
}

Expand Down
1 change: 1 addition & 0 deletions pie/ints_pie.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func (ss Ints) Diff(against Ints) (added, removed Ints) {
if s == element {
ss2 = append(ss2[:i], ss2[i+1:]...)
found = true
break
}
}

Expand Down
1 change: 1 addition & 0 deletions pie/strings_pie.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func (ss Strings) Diff(against Strings) (added, removed Strings) {
if s == element {
ss2 = append(ss2[:i], ss2[i+1:]...)
found = true
break
}
}

Expand Down
1 change: 1 addition & 0 deletions template.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1d6cd85

Please sign in to comment.