gjson icon indicating copy to clipboard operation
gjson copied to clipboard

GetMany function seems do something unnecessary

Open yiippee opened this issue 2 years ago • 1 comments

Thanks for your fast JSON parser.

func GetMany(json string, path ...string) []Result {
	res := make([]Result, len(path))
	for i, path := range path {
		res[i] = Get(json, path)
	}
	return res
}

GetMany function just for loop calls Get function. It seems to parse the json string for very loop, and it is not efficient because of the first loop has got the information about the json string. Maybe I misunderstand something? Thanks again.

yiippee avatar Dec 30 '21 08:12 yiippee

I have the same doubts as you do

CharmCcc avatar Sep 15 '23 07:09 CharmCcc