Commit 5ce98da1 authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

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
parent cc817121
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment