Skip to content

Commit f83142d

Browse files
committed
replace statForRetry with stat (review reflected)
1 parent e5e8ed6 commit f83142d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

internal/decoder/stream.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,7 @@ func (s *Stream) skipObject(depth int64) error {
280280
if char(p, cursor) == nul {
281281
s.cursor = cursor
282282
if s.read() {
283-
_, cursor, p = s.statForRetry()
284-
cursor++
283+
_, cursor, p = s.stat()
285284
continue
286285
}
287286
return errors.ErrUnexpectedEndOfJSON("string of object", cursor)
@@ -344,8 +343,7 @@ func (s *Stream) skipArray(depth int64) error {
344343
if char(p, cursor) == nul {
345344
s.cursor = cursor
346345
if s.read() {
347-
_, cursor, p = s.statForRetry()
348-
cursor++
346+
_, cursor, p = s.stat()
349347
continue
350348
}
351349
return errors.ErrUnexpectedEndOfJSON("string of object", cursor)
@@ -403,8 +401,7 @@ func (s *Stream) skipValue(depth int64) error {
403401
if char(p, cursor) == nul {
404402
s.cursor = cursor
405403
if s.read() {
406-
_, cursor, p = s.statForRetry()
407-
cursor++
404+
_, cursor, p = s.stat()
408405
continue
409406
}
410407
return errors.ErrUnexpectedEndOfJSON("value of string", s.totalOffset())

0 commit comments

Comments
 (0)