Skip to content

Commit 460dc37

Browse files
Jorropogopherbot
authored andcommitted
io: remove manual SectionReader.Size in SectionReader.ReadAt
Change-Id: Ib3e8953dbdefa2b78c31b1bcbf0909bce248e423 Reviewed-on: https://go-review.googlesource.com/c/go/+/500475 Reviewed-by: Robert Griesemer <[email protected]> Reviewed-by: qiulaidongfeng <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Robert Griesemer <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]>
1 parent 9fc3feb commit 460dc37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/io/io.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ func (s *SectionReader) Seek(offset int64, whence int) (int64, error) {
540540
}
541541

542542
func (s *SectionReader) ReadAt(p []byte, off int64) (n int, err error) {
543-
if off < 0 || off >= s.limit-s.base {
543+
if off < 0 || off >= s.Size() {
544544
return 0, EOF
545545
}
546546
off += s.base

0 commit comments

Comments
 (0)