You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-12 22:47:42 +02:00
remove callback api
This commit is contained in:
@ -50,17 +50,6 @@ func Test_two_elements(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func Test_two_elements_cb(t *testing.T) {
|
||||
iter := ParseString(`[1,2]`)
|
||||
total := int64(0)
|
||||
iter.ReadArrayCB(func() {
|
||||
total += iter.ReadInt64()
|
||||
})
|
||||
if total != 3 {
|
||||
t.Fatal(total)
|
||||
}
|
||||
}
|
||||
|
||||
func Test_invalid_array(t *testing.T) {
|
||||
iter := ParseString(`[`)
|
||||
iter.ReadArray()
|
||||
@ -141,19 +130,6 @@ func Benchmark_jsoniter_array(b *testing.B) {
|
||||
}
|
||||
}
|
||||
|
||||
func Benchmark_jsoniter_array_cb(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
input := []byte(`[1,2,3,4,5,6,7,8,9]`)
|
||||
iter := ParseBytes(input)
|
||||
b.ResetTimer()
|
||||
for n := 0; n < b.N; n++ {
|
||||
iter.Reuse(input)
|
||||
iter.ReadArrayCB(func() {
|
||||
iter.ReadUint64()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Benchmark_json_array(b *testing.B) {
|
||||
for n := 0; n < b.N; n++ {
|
||||
result := []interface{}{}
|
||||
|
Reference in New Issue
Block a user