Merge pull request #7494 from AkihiroSuda/diff-apply-fix-read-count

This commit is contained in:
Fu Wei 2022-10-10 20:53:51 +08:00 committed by GitHub
commit 7f33a20da2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,6 +125,8 @@ type readCounter struct {
func (rc *readCounter) Read(p []byte) (n int, err error) { func (rc *readCounter) Read(p []byte) (n int, err error) {
n, err = rc.r.Read(p) n, err = rc.r.Read(p)
rc.c += int64(n) if n > 0 {
rc.c += int64(n)
}
return return
} }