mirror of
https://github.com/golang/go
synced 2024-11-24 08:00:12 -07:00
net: simplify code
Single-case select with a non-nil channel is pointless. LGTM=mikioh.mikioh R=mikioh.mikioh CC=golang-codereviews https://golang.org/cl/103920044
This commit is contained in:
parent
cc81712190
commit
5ce98da1a2
@ -214,14 +214,12 @@ func dialMulti(net, addr string, la Addr, ras addrList, deadline time.Time) (Con
|
||||
nracers := len(ras)
|
||||
for nracers > 0 {
|
||||
sig <- true
|
||||
select {
|
||||
case racer := <-lane:
|
||||
if racer.error == nil {
|
||||
return racer.Conn, nil
|
||||
}
|
||||
lastErr = racer.error
|
||||
nracers--
|
||||
racer := <-lane
|
||||
if racer.error == nil {
|
||||
return racer.Conn, nil
|
||||
}
|
||||
lastErr = racer.error
|
||||
nracers--
|
||||
}
|
||||
return nil, lastErr
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user