From 82935438620e3f55d0daaeccc9c426aedd8bfa84 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 24 Feb 2011 03:22:24 +0000 Subject: [PATCH] fix iterator bug in dht rss items --- src/kademlia/node.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kademlia/node.cpp b/src/kademlia/node.cpp index 47ddf46a9..b878e07f2 100644 --- a/src/kademlia/node.cpp +++ b/src/kademlia/node.cpp @@ -1021,12 +1021,12 @@ void node_impl::incoming_request(msg const& m, entry& e) { // delete the least important one (i.e. the one // the fewest peers are announcing) - i = std::min_element(m_feeds.begin(), m_feeds.end() + feed_table_t::iterator j = std::min_element(m_feeds.begin(), m_feeds.end() , boost::bind(&feed_item::num_announcers , boost::bind(&feed_table_t::value_type::second, _1))); - TORRENT_ASSERT(i != m_feeds.end()); + TORRENT_ASSERT(j != m_feeds.end()); // std::cerr << " removing: " << i->second.item << std::endl; - m_feeds.erase(i); + m_feeds.erase(j); } boost::tie(i, boost::tuples::ignore) = m_feeds.insert(std::make_pair(target, add_item)); }