Skip to content

Commit

Permalink
fix json-iterator#264 check io.EOF when test decoder.More
Browse files Browse the repository at this point in the history
  • Loading branch information
taowen committed Apr 20, 2018
1 parent 0841368 commit b2987be
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,14 @@ func (adapter *Decoder) Decode(obj interface{}) error {

// More is there more?
func (adapter *Decoder) More() bool {
if adapter.iter.head != adapter.iter.tail {
iter := adapter.iter
if iter.Error != nil {
return false
}
if iter.head != iter.tail {
return true
}
return adapter.iter.loadMore()
return iter.loadMore()
}

// Buffered remaining buffer
Expand Down

0 comments on commit b2987be

Please sign in to comment.