tidwall / gjson

Get JSON values quickly - JSON parser for Go
MIT License
14.1k stars 846 forks source link

GetMany function seems do something unnecessary #259

Open yiippee opened 2 years ago

yiippee commented 2 years ago

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.

CharmCcc commented 11 months ago

I have the same doubts as you do