Optimized counting number of DHT peers.
This commit is contained in:
parent
a69be4161b
commit
ba53e0268f
|
@ -305,14 +305,8 @@ long count_DHT_peers(entry &state)
|
||||||
if (nodes)
|
if (nodes)
|
||||||
{
|
{
|
||||||
entry::list_type &peers = nodes->list();
|
entry::list_type &peers = nodes->list();
|
||||||
entry::list_type::const_iterator i;
|
|
||||||
i = peers.begin();
|
num_peers = peers.size();
|
||||||
|
|
||||||
while (i != peers.end())
|
|
||||||
{
|
|
||||||
num_peers++;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return num_peers;
|
return num_peers;
|
||||||
|
|
Loading…
Reference in New Issue