From: YenForYang Date: Mon, 27 Sep 2021 02:41:20 +0000 (-0500) Subject: Inlineable `addrIndex` (#673) X-Git-Tag: v1.32.0~18 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=644a746b6b2302ae2fc1b31024a07d4e702615ff;p=btrtrc.git Inlineable `addrIndex` (#673) --- diff --git a/pex.go b/pex.go index a808af2b..22834436 100644 --- a/pex.go +++ b/pex.go @@ -55,7 +55,7 @@ func addrEqual(a, b *krpc.NodeAddr) bool { } func addrIndex(v []krpc.NodeAddr, a *krpc.NodeAddr) int { - for i := range v { + for i := 0; i < len(v); i += 1 { if addrEqual(&v[i], a) { return i }