Inlineable `addrIndex` (#673)

This commit is contained in:
YenForYang 2021-09-26 21:41:20 -05:00 committed by GitHub
parent 76f593e36b
commit 644a746b6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

2
pex.go
View File

@ -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
}