From ba53e0268f602f2115623fe9c2c4d8299c077a9b Mon Sep 17 00:00:00 2001 From: Alex Dedul Date: Fri, 3 Aug 2007 09:06:29 +0000 Subject: [PATCH] Optimized counting number of DHT peers. --- src/deluge_core.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/deluge_core.cpp b/src/deluge_core.cpp index ecc3bc9b6..58b4e4736 100644 --- a/src/deluge_core.cpp +++ b/src/deluge_core.cpp @@ -305,14 +305,8 @@ long count_DHT_peers(entry &state) if (nodes) { entry::list_type &peers = nodes->list(); - entry::list_type::const_iterator i; - i = peers.begin(); - - while (i != peers.end()) - { - num_peers++; - i++; - } + + num_peers = peers.size(); } return num_peers;