func (s *PathElementSet) Union(s2 *PathElementSet) *PathElementSet {
	out := &PathElementSet{}

	i, j := 0, 0
	for i < len(s.members) && j < len(s2.members) {
		if s.members[i].Less(s2.members[j]) {
			out.members = append(out.members, s.members[i])
			i++
		} else {
			out.members = append(out.members, s2.members[j])
			if !s2.members[j].Less(s.members[i]) {
				i++
			}
			j++
		}
	}

	if i < len(s.members) {
		out.members = append(out.members, s.members[i:]...)
	}
	if j < len(s2.members) {
		out.members = append(out.members, s2.members[j:]...)
	}
	return out
}
// Union returns a set containing elements that appear in either s or s2.
Union returns a set containing elements that appear in either s or s2.
// Union returns a set containing elements that appear in either s or s2 .
func (s *PathElementSet) Union(s2 *PathElementSet) *PathElementSet {
	out := &PathElementSet{}
	i, j := 0, 0
	for i < len(s.members) && j < len(s2.members) {
		if s.members[i].Less(s2.members[j]) {
			out.members = append(out.members, s.members[i])
			i++
		} else {
			out.members = append(out.members, s2.members[j])
			if !s2.members[j].Less(s.members[i]) {
				i++
			}
			j++
		}
	}
	if i < len(s.members) {
		out.members = append(out.members, s.members[i:]...)
	}
	if j < len(s2.members) {
		out.members = append(out.members, s2.members[j:]...)
	}
	return out
}
func ( s * PathElementSet ) Union ( s2 * PathElementSet ) * PathElementSet { out := & PathElementSet { } i , j := 0 , 0 for i < len ( s . members ) && j < len ( s2 . members ) { if s . members [ i ] . Less ( s2 . members [ j ] ) { out . members = append ( out . members , s . members [ i ] ) i ++ } else { out . members = append ( out . members , s2 . members [ j ] ) if ! s2 . members [ j ] . Less ( s . members [ i ] ) { i ++ } j ++ } } if i < len ( s . members ) { out . members = append ( out . members , s . members [ i : ] ... ) } if j < len ( s2 . members ) { out . members = append ( out . members , s2 . members [ j : ] ... ) } return out }
Union returns a set containing elements that appear in either s or s2.
Union returns a set containing elements that appear in either s or s2 .