func (s *PathElementSet) Intersection(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]) {
			i++
		} else {
			if !s2.members[j].Less(s.members[i]) {
				out.members = append(out.members, s.members[i])
				i++
			}
			j++
		}
	}

	return out
}
// Intersection returns a set containing elements which appear in both s and s2.
Intersection returns a set containing elements which appear in both s and s2.
// Intersection returns a set containing elements which appear in both s and s2 .
func (s *PathElementSet) Intersection(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]) {
			i++
		} else {
			if !s2.members[j].Less(s.members[i]) {
				out.members = append(out.members, s.members[i])
				i++
			}
			j++
		}
	}
	return out
}
func ( s * PathElementSet ) Intersection ( 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 ] ) { i ++ } else { if ! s2 . members [ j ] . Less ( s . members [ i ] ) { out . members = append ( out . members , s . members [ i ] ) i ++ } j ++ } } return out }
Intersection returns a set containing elements which appear in both s and s2.
Intersection returns a set containing elements which appear in both s and s2 .