Skip to content

Commit

Permalink
Rename function arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
b97tsk committed Jan 23, 2024
1 parent 9b3c78d commit 867d19d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions symdiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,21 @@ func SymmetricDifference[E Elem[E]](z, x, y Set[E]) Set[E] {
}
}

func appendInterval[E Elem[E]](s Set[E], r Interval[E]) Set[E] {
if n := len(s); n != 0 {
if r1 := &s[n-1]; r1.High.Compare(r.Low) == 0 {
func appendInterval[E Elem[E]](x Set[E], r Interval[E]) Set[E] {
if n := len(x); n != 0 {
if r1 := &x[n-1]; r1.High.Compare(r.Low) == 0 {
r1.High = r.High
return s
return x
}
}

return append(s, r)
return append(x, r)
}

func appendIntervals[E Elem[E]](s Set[E], rs ...Interval[E]) Set[E] {
if len(rs) == 0 {
return s
func appendIntervals[E Elem[E]](x Set[E], s ...Interval[E]) Set[E] {
if len(s) == 0 {
return x
}

return append(appendInterval(s, rs[0]), rs[1:]...)
return append(appendInterval(x, s[0]), s[1:]...)
}

0 comments on commit 867d19d

Please sign in to comment.