1
0
mirror of https://github.com/golang/go synced 2024-11-23 19:20:03 -07:00

internal/poll: Avoid evaluating condition for an unreachable branch

Change-Id: I868dcaf84767d631bc8f1b6ef6bcb3ec18047259
Reviewed-on: https://go-review.googlesource.com/116135
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Shivansh Rai 2018-06-04 17:10:43 +05:30 committed by Brad Fitzpatrick
parent a3593685cf
commit d05f31a3c5
3 changed files with 3 additions and 6 deletions

View File

@ -32,8 +32,7 @@ func SendFile(dstFD *FD, src int, pos, remain int64) (int64, error) {
pos += int64(n) pos += int64(n)
written += int64(n) written += int64(n)
remain -= int64(n) remain -= int64(n)
} } else if n == 0 && err1 == nil {
if n == 0 && err1 == nil {
break break
} }
if err1 == syscall.EAGAIN { if err1 == syscall.EAGAIN {

View File

@ -29,8 +29,7 @@ func SendFile(dstFD *FD, src int, remain int64) (int64, error) {
if n > 0 { if n > 0 {
written += int64(n) written += int64(n)
remain -= int64(n) remain -= int64(n)
} } else if n == 0 && err1 == nil {
if n == 0 && err1 == nil {
break break
} }
if err1 == syscall.EAGAIN { if err1 == syscall.EAGAIN {

View File

@ -39,8 +39,7 @@ func SendFile(dstFD *FD, src int, pos, remain int64) (int64, error) {
pos += int64(n) pos += int64(n)
written += int64(n) written += int64(n)
remain -= int64(n) remain -= int64(n)
} } else if n == 0 && err1 == nil {
if n == 0 && err1 == nil {
break break
} }
if err1 == syscall.EAGAIN { if err1 == syscall.EAGAIN {