|
@@ -4,6 +4,7 @@
|
4
|
4
|
package sno
|
5
|
5
|
|
6
|
6
|
import (
|
|
7
|
+ "sort"
|
7
|
8
|
"strings"
|
8
|
9
|
)
|
9
|
10
|
|
|
@@ -34,6 +35,10 @@ func (masks Masks) Contains(mask Mask) bool {
|
34
|
35
|
return false
|
35
|
36
|
}
|
36
|
37
|
|
|
38
|
+func (masks Masks) Sort() {
|
|
39
|
+ sort.Slice(masks, func(i, j int) bool { return masks[i] < masks[j] })
|
|
40
|
+}
|
|
41
|
+
|
37
|
42
|
// Evaluate changes to snomasks made with MODE. There are several cases:
|
38
|
43
|
// adding snomasks with `/mode +s a` or `/mode +s +a`, removing them with `/mode +s -a`,
|
39
|
44
|
// adding all with `/mode +s *` or `/mode +s +*`, removing all with `/mode +s -*` or `/mode -s`
|