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 ...@@ -214,14 +214,12 @@ func dialMulti(net, addr string, la Addr, ras addrList, deadline time.Time) (Con
nracers := len(ras) nracers := len(ras)
for nracers > 0 { for nracers > 0 {
sig <- true sig <- true
select { racer := <-lane
case racer := <-lane: if racer.error == nil {
if racer.error == nil { return racer.Conn, nil
return racer.Conn, nil
}
lastErr = racer.error
nracers--
} }
lastErr = racer.error
nracers--
} }
return nil, lastErr 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