]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Inlineable `addrIndex` (#673)
authorYenForYang <YenForYang@users.noreply.github.com>
Mon, 27 Sep 2021 02:41:20 +0000 (21:41 -0500)
committerGitHub <noreply@github.com>
Mon, 27 Sep 2021 02:41:20 +0000 (12:41 +1000)
pex.go

diff --git a/pex.go b/pex.go
index a808af2bc0f9bc6c3724b5d8c4663e03182d67e6..22834436b826dade3e0a830ca10fc7440745fddc 100644 (file)
--- 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
                }