From a8714895f5f99a4245fcdc5842e790fb21cd9aac Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Sun, 4 Dec 2016 18:37:26 +0100 Subject: 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. --- manager.go | 6 +++--- 1 file 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 { -- cgit v1.2.3