fix: use policy match weight to override less specific policy

This commit is contained in:
Qiu Jian
2019-08-22 09:08:15 +08:00
parent 87e37f2497
commit a177f8c2af
10 changed files with 693 additions and 51 deletions

View File

@@ -84,6 +84,24 @@ func (ss SSortedStrings) ContainsAll(needles ...string) bool {
return true
}
func Contains(a, b SSortedStrings) bool {
_, _, bNoA := Split(a, b)
if len(bNoA) == 0 {
return true
} else {
return false
}
}
func Equals(a, b SSortedStrings) bool {
aNoB, _, bNoA := Split(a, b)
if len(aNoB) == 0 && len(bNoA) == 0 {
return true
} else {
return false
}
}
func Split(a, b SSortedStrings) (aNoB SSortedStrings, aAndB SSortedStrings, bNoA SSortedStrings) {
a_b := make([]string, 0)
b_a := make([]string, 0)