storage/memorybysubnet: replace range with len()
This commit is contained in:
parent
370004a9f5
commit
d07b61d67d
1 changed files with 2 additions and 6 deletions
|
@ -133,18 +133,14 @@ type swarm struct {
|
||||||
|
|
||||||
func (s swarm) lenSeeders() (i int) {
|
func (s swarm) lenSeeders() (i int) {
|
||||||
for _, subnet := range s.seeders {
|
for _, subnet := range s.seeders {
|
||||||
for range subnet {
|
i += len(subnet)
|
||||||
i++
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s swarm) lenLeechers() (i int) {
|
func (s swarm) lenLeechers() (i int) {
|
||||||
for _, subnet := range s.leechers {
|
for _, subnet := range s.leechers {
|
||||||
for range subnet {
|
i += len(subnet)
|
||||||
i++
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue