jsonparser icon indicating copy to clipboard operation
jsonparser copied to clipboard

Arrayeach early termination

Open xphil opened this issue 7 years ago • 1 comments

Description: What this PR does Added ability to terminate ArrayEach() from within its callback, by setting error to some value. Previous implementation didn't make much sense, since error was always nil.

Benchmark before change: Benchmark is currently broken, but this fix should not change benchmark times in any way. Might fix benchmark later.

Benchmark after change:

For running benchmarks use:

go test -test.benchmem -bench JsonParser ./benchmark/ -benchtime 5s -v
# OR
make bench (runs inside docker)

xphil avatar Apr 16 '18 01:04 xphil

@xphil I just noticed this PR, after I opened https://github.com/buger/jsonparser/pull/156

What do you think of that patch? It's a similar goal as this one except it has the callback return an error. I also fixed the benchmarks to get them to run again.

jlhawn avatar Nov 13 '18 18:11 jlhawn