From: Aaron Jacobs Date: Fri, 24 Jul 2015 04:21:11 +0000 (+1000) Subject: os: remove a redundant branch in File.Read. X-Git-Tag: go1.6beta1~1221 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=019297a9aa63fc1ee016e0ff4f4d86e8dc578541;p=gostls13.git os: remove a redundant branch in File.Read. All implementations of File.read ensure that n >= 0. This is usually via fixCount, except for Windows console reads, which only ever add to n. Change-Id: Ic019d6a2da5ef1ac68d2690c908deca4fcc6b4a4 Reviewed-on: https://go-review.googlesource.com/12624 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/os/file.go b/src/os/file.go index 8c0e3ffe1b..69338ce09a 100644 --- a/src/os/file.go +++ b/src/os/file.go @@ -93,9 +93,6 @@ func (f *File) Read(b []byte) (n int, err error) { return 0, ErrInvalid } n, e := f.read(b) - if n < 0 { - n = 0 - } if n == 0 && len(b) > 0 && e == nil { return 0, io.EOF }