Return correct next state from Read
This commit is contained in:
parent
e6debbd7dc
commit
776b513c44
@ -127,8 +127,8 @@ type State[In any] struct {
|
|||||||
|
|
||||||
func (s State[In]) Read(dst []In) (n uint64, next State[In], err error) {
|
func (s State[In]) Read(dst []In) (n uint64, next State[In], err error) {
|
||||||
nread, err := s.r.ReadAt(dst, int64(s.pos))
|
nread, err := s.r.ReadAt(dst, int64(s.pos))
|
||||||
if n > 0 {
|
if nread > 0 {
|
||||||
s.pos += uint64(n)
|
s.pos += uint64(nread)
|
||||||
}
|
}
|
||||||
return uint64(nread), s, err
|
return uint64(nread), s, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user