summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvan Jegen <s.jegen@gmail.com>2016-12-04 18:37:26 +0100
committerSilvan Jegen <s.jegen@gmail.com>2016-12-04 18:37:26 +0100
commita8714895f5f99a4245fcdc5842e790fb21cd9aac (patch)
treee2c23e924ee469594fe4808a83316d5c7d657451
parent5249fc020067417846bd6cae3f05b6064ddbb1f7 (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.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/manager.go b/manager.go
index 10de4ef..470fbf3 100644
--- a/manager.go
+++ b/manager.go
@@ -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 {