diff options
author | Silvan Jegen <s.jegen@gmail.com> | 2016-12-04 18:37:26 +0100 |
---|---|---|
committer | Silvan Jegen <s.jegen@gmail.com> | 2016-12-04 18:37:26 +0100 |
commit | a8714895f5f99a4245fcdc5842e790fb21cd9aac (patch) | |
tree | e2c23e924ee469594fe4808a83316d5c7d657451 | |
parent | 5249fc020067417846bd6cae3f05b6064ddbb1f7 (diff) |
Iterate over filter functions instead of input fields
That way we make sure that we don't check fields that we won't need to
look at.
-rw-r--r-- | manager.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -84,13 +84,13 @@ func (f *StringFilter) Filter(w *Work) *Work { } changed := false - for k, v := range jm { - ff, ok := f.FilterFuncMap[k] + for field, ff := range f.FilterFuncMap { + str, ok := jm[field] if !ok { continue } - jm[k] = ff(v) + jm[field] = ff(str) changed = true } if changed { |