1
0
mirror of https://github.com/json-iterator/go.git synced 2024-11-24 08:22:14 +02:00

fix #264 check io.EOF when test decoder.More

This commit is contained in:
Tao Wen 2018-04-20 16:10:56 +08:00
parent f88871b601
commit 6c702ce12a

View File

@ -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