From 1b1f52024eb9608a6b9c5a3df38490648d09ae97 Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Sun, 21 Aug 2016 05:32:34 -0700 Subject: [PATCH] minor optimization --- gjson.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gjson.go b/gjson.go index 46fd326..2572aff 100644 --- a/gjson.go +++ b/gjson.go @@ -135,7 +135,9 @@ func Get(json string, path string) Result { next_part: // be optimistic that the path mostly contains lowercase and // underscore characters. - if path[i] <= '\\' { + if path[i] >= '_' { + continue + } else if path[i] <= '\\' { if path[i] == '\\' { // go into escape mode. this is a slower path that // strips off the escape character from the part.