func (pe *PathExp) CompareSpecificity(other *PathExp) int {
	if cmp := compareSegmentType(pe.envs, other.envs); cmp != 0 {
		return cmp
	}

	if cmp := compareSegmentType(pe.services, other.services); cmp != 0 {
		return cmp
	}

	if cmp := compareSegmentType(pe.identities, other.identities); cmp != 0 {
		return cmp
	}

	return compareSegmentType(pe.instances, other.instances)
}
// CompareSpecificity returns an int indicating if this PathExp is more
// specific than PathExp b.
//
// PathExp A is more specific then PathExp B if, for each segment in the
// PathExp, A's segment is as specific or more specific than B's segment.
//
// Segment specificity is, from most to least specific:
//	- <literal>
//  - <glob>
//  - <alternation>
//  - <fullglob>
//
// It is assumed that the provided PathExps are not disjoint.
CompareSpecificity returns an int indicating if this PathExp is more
specific than PathExp b.

PathExp A is more specific then PathExp B if, for each segment in the
PathExp, A's segment is as specific or more specific than B's segment.

Segment specificity is, from most to least specific:
- 
- 
- 
- 

It is assumed that the provided PathExps are not disjoint.
// CompareSpecificity returns an int indicating if this PathExp is more // specific than PathExp b . // // PathExp A is more specific then PathExp B if for each segment in the // PathExp A ' s segment is as specific or more specific than B ' s segment . // // Segment specificity is from most to least specific : // - <literal > // - <glob > // - <alternation > // - <fullglob > // // It is assumed that the provided PathExps are not disjoint .
func (pe *PathExp) CompareSpecificity(other *PathExp) int {
	if cmp := compareSegmentType(pe.envs, other.envs); cmp != 0 {
		return cmp
	}
	if cmp := compareSegmentType(pe.services, other.services); cmp != 0 {
		return cmp
	}
	if cmp := compareSegmentType(pe.identities, other.identities); cmp != 0 {
		return cmp
	}
	return compareSegmentType(pe.instances, other.instances)
}
func ( pe * PathExp ) CompareSpecificity ( other * PathExp ) int { if cmp := compareSegmentType ( pe . envs , other . envs ) ; cmp != 0 { return cmp } if cmp := compareSegmentType ( pe . services , other . services ) ; cmp != 0 { return cmp } if cmp := compareSegmentType ( pe . identities , other . identities ) ; cmp != 0 { return cmp } return compareSegmentType ( pe . instances , other . instances ) }
CompareSpecificity returns an int indicating if this PathExp is more
specific than PathExp b.
CompareSpecificity returns an int indicating if this PathExp is more specific than PathExp b .