Skip to content

Commit

Permalink
replace statForRetry with stat (review reflected)
Browse files Browse the repository at this point in the history
  • Loading branch information
KimHyeonwoo committed Aug 2, 2022
1 parent e5e8ed6 commit f83142d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions internal/decoder/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,7 @@ func (s *Stream) skipObject(depth int64) error {
if char(p, cursor) == nul {
s.cursor = cursor
if s.read() {
_, cursor, p = s.statForRetry()
cursor++
_, cursor, p = s.stat()
continue
}
return errors.ErrUnexpectedEndOfJSON("string of object", cursor)
Expand Down Expand Up @@ -344,8 +343,7 @@ func (s *Stream) skipArray(depth int64) error {
if char(p, cursor) == nul {
s.cursor = cursor
if s.read() {
_, cursor, p = s.statForRetry()
cursor++
_, cursor, p = s.stat()
continue
}
return errors.ErrUnexpectedEndOfJSON("string of object", cursor)
Expand Down Expand Up @@ -403,8 +401,7 @@ func (s *Stream) skipValue(depth int64) error {
if char(p, cursor) == nul {
s.cursor = cursor
if s.read() {
_, cursor, p = s.statForRetry()
cursor++
_, cursor, p = s.stat()
continue
}
return errors.ErrUnexpectedEndOfJSON("value of string", s.totalOffset())
Expand Down

0 comments on commit f83142d

Please sign in to comment.