glob/match/util.go

22 lines
290 B
Go
Raw Permalink Normal View History

2018-02-16 17:36:02 +03:00
package match
func minLen(ms []Matcher) (min int) {
for i, m := range ms {
n := m.MinLen()
if i == 0 || n < min {
min = n
}
}
return min
}
2019-02-06 23:43:38 +03:00
func maxLen(ms []Matcher) (max int) {
for i, m := range ms {
n := m.MinLen()
if i == 0 || n > max {
max = n
}
}
return max
}