minor optimization

This commit is contained in:
Josh Baker 2016-08-21 05:32:34 -07:00
parent 3a4fec0606
commit 1b1f52024e
1 changed files with 3 additions and 1 deletions

View File

@ -135,7 +135,9 @@ func Get(json string, path string) Result {
next_part: next_part:
// be optimistic that the path mostly contains lowercase and // be optimistic that the path mostly contains lowercase and
// underscore characters. // underscore characters.
if path[i] <= '\\' { if path[i] >= '_' {
continue
} else if path[i] <= '\\' {
if path[i] == '\\' { if path[i] == '\\' {
// go into escape mode. this is a slower path that // go into escape mode. this is a slower path that
// strips off the escape character from the part. // strips off the escape character from the part.