From 5cd723d566400bc7ac450eb0c5b9edbb75a70750 Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Fri, 22 Dec 2017 07:19:48 -0700 Subject: [PATCH] simplify getmanybytes --- gjson.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gjson.go b/gjson.go index ef11ecf..d2814ef 100644 --- a/gjson.go +++ b/gjson.go @@ -1610,11 +1610,7 @@ func GetMany(json string, path ...string) []Result { // The return value is a Result array where the number of items // will be equal to the number of input paths. func GetManyBytes(json []byte, path ...string) []Result { - res := make([]Result, len(path)) - for i, path := range path { - res[i] = GetBytes(json, path) - } - return res + return GetMany(string(json), path...) } var fieldsmu sync.RWMutex