From 61a9ab4ee0fea9dfe9fcea529d1b2f151b6f16f9 Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Thu, 11 Aug 2016 09:44:22 -0700 Subject: [PATCH] minor optimization --- buntdb.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/buntdb.go b/buntdb.go index 7bba400..8e53292 100644 --- a/buntdb.go +++ b/buntdb.go @@ -1572,11 +1572,6 @@ func IndexJSONCaseSensitive(path string) func(a, b string) bool { func jsonIndex(cs bool, path string) func(a, b string) bool { return func(a, b string) bool { - atok := gjson.Get(a, path) - btok := gjson.Get(b, path) - if atok.Less(btok, cs) { - return true - } - return false + return gjson.Get(a, path).Less(gjson.Get(b, path), cs) } }