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) {
|
||||
for _, subnet := range s.seeders {
|
||||
for range subnet {
|
||||
i++
|
||||
}
|
||||
i += len(subnet)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s swarm) lenLeechers() (i int) {
|
||||
for _, subnet := range s.leechers {
|
||||
for range subnet {
|
||||
i++
|
||||
}
|
||||
i += len(subnet)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue