Contains returns true if all ls contains all the labels in needed. If needed contains no labels, Contains() will always return true
(needed LabelArray)
| 84 | // Contains returns true if all ls contains all the labels in needed. If |
| 85 | // needed contains no labels, Contains() will always return true |
| 86 | func (ls LabelArray) Contains(needed LabelArray) bool { |
| 87 | nextLabel: |
| 88 | for i := range needed { |
| 89 | for l := range ls { |
| 90 | if ls[l].Has(&needed[i]) { |
| 91 | continue nextLabel |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | return false |
| 96 | } |
| 97 | |
| 98 | return true |
| 99 | } |
| 100 | |
| 101 | // Intersects returns true if ls contains at least one label in needed. |
| 102 | // |