Commit d7e8e0a94e5116e22f5afb860489c01302d4e67d
1 parent
ad6d508b94
Exists in
master
count; add
Showing
1 changed file
with
4 additions
and
4 deletions
Show diff stats
filtering.go
... | ... | @@ -14,12 +14,12 @@ func (f Filter) Get(key string) (values []string, ok bool) { |
14 | 14 | return values, ok |
15 | 15 | } |
16 | 16 | |
17 | -func (f Filter) Size() int { | |
17 | +func (f Filter) Count() int { | |
18 | 18 | return len(f) |
19 | 19 | } |
20 | 20 | |
21 | -func (f Filter) IsNotEmpty() bool { | |
22 | - return len(f) > 0 | |
21 | +func (f Filter) Add(key, val string) { | |
22 | + f[key] = append(f[key], val) | |
23 | 23 | } |
24 | 24 | |
25 | 25 | func (f Filter) ValueAt(val string, index int) string { |
... | ... | @@ -84,7 +84,7 @@ func MakeFilterString(prefix string, filters Filter, validFilters []string) (res |
84 | 84 | prefix += "." |
85 | 85 | } |
86 | 86 | |
87 | - if !filters.IsNotEmpty() { | |
87 | + if filters.Count() == 0 { | |
88 | 88 | return "", true |
89 | 89 | } |
90 | 90 | ... | ... |