tidwall / gjson

Get JSON values quickly - JSON parser for Go
MIT License
13.95k stars 841 forks source link

Add Result.Equal(r Result, bool caseSensitive) bool #276

Open bjoerndemeyer opened 2 years ago

bjoerndemeyer commented 2 years ago

I have a need for an Equal comparison for Results. Now I am simulating it with ! r1.Less(r2) && !r2.Less(r1) but that does not seem very performant. The == operator cannot be used on Result, it gives: invalid operation: r1 == r2 (struct containing []int cannot be compared). I'm willing to provide a PR for this if you think the Equal method for Result is acceptable.