aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/json-iterator/go/iter_array.go
diff options
context:
space:
mode:
authorLibravatar Rutger Broekhoff2024-01-02 18:56:31 +0100
committerLibravatar Rutger Broekhoff2024-01-02 18:56:31 +0100
commit8db41da676ac8368ef7c2549d56239a5ff5eedde (patch)
tree09c427fd66de2ec1ebffc8342f5fdbb84b0701b5 /vendor/github.com/json-iterator/go/iter_array.go
parentd4f75fb6db22e57577867445a022227e70958931 (diff)
downloadgitolfs3-8db41da676ac8368ef7c2549d56239a5ff5eedde.tar.gz
gitolfs3-8db41da676ac8368ef7c2549d56239a5ff5eedde.zip
Delete vendor directory
Diffstat (limited to 'vendor/github.com/json-iterator/go/iter_array.go')
-rw-r--r--vendor/github.com/json-iterator/go/iter_array.go64
1 files changed, 0 insertions, 64 deletions
diff --git a/vendor/github.com/json-iterator/go/iter_array.go b/vendor/github.com/json-iterator/go/iter_array.go
deleted file mode 100644
index 204fe0e..0000000
--- a/vendor/github.com/json-iterator/go/iter_array.go
+++ /dev/null
@@ -1,64 +0,0 @@
1package jsoniter
2
3// ReadArray read array element, tells if the array has more element to read.
4func (iter *Iterator) ReadArray() (ret bool) {
5 c := iter.nextToken()
6 switch c {
7 case 'n':
8 iter.skipThreeBytes('u', 'l', 'l')
9 return false // null
10 case '[':
11 c = iter.nextToken()
12 if c != ']' {
13 iter.unreadByte()
14 return true
15 }
16 return false
17 case ']':
18 return false
19 case ',':
20 return true
21 default:
22 iter.ReportError("ReadArray", "expect [ or , or ] or n, but found "+string([]byte{c}))
23 return
24 }
25}
26
27// ReadArrayCB read array with callback
28func (iter *Iterator) ReadArrayCB(callback func(*Iterator) bool) (ret bool) {
29 c := iter.nextToken()
30 if c == '[' {
31 if !iter.incrementDepth() {
32 return false
33 }
34 c = iter.nextToken()
35 if c != ']' {
36 iter.unreadByte()
37 if !callback(iter) {
38 iter.decrementDepth()
39 return false
40 }
41 c = iter.nextToken()
42 for c == ',' {
43 if !callback(iter) {
44 iter.decrementDepth()
45 return false
46 }
47 c = iter.nextToken()
48 }
49 if c != ']' {
50 iter.ReportError("ReadArrayCB", "expect ] in the end, but found "+string([]byte{c}))
51 iter.decrementDepth()
52 return false
53 }
54 return iter.decrementDepth()
55 }
56 return iter.decrementDepth()
57 }
58 if c == 'n' {
59 iter.skipThreeBytes('u', 'l', 'l')
60 return true // null
61 }
62 iter.ReportError("ReadArrayCB", "expect [ or n, but found "+string([]byte{c}))
63 return false
64}