make the invariant check less expensive

This commit is contained in:
Arvid Norberg 2010-10-04 03:26:42 +00:00
parent 7d94fff11a
commit e1948fa203
1 changed files with 3 additions and 3 deletions

View File

@ -5091,7 +5091,7 @@ namespace libtorrent
int num_peers_with_timeouts;
int num_peers_with_nowant;
int num_not_requested;
std::vector<peer_connection const*> peers;
// std::vector<peer_connection const*> peers;
};
void peer_connection::check_invariant() const
@ -5230,7 +5230,7 @@ namespace libtorrent
++num_requests[i->block].num_peers_with_timeouts;
++num_requests[i->block].num_peers_with_nowant;
++num_requests[i->block].num_not_requested;
num_requests[i->block].peers.push_back(&p);
// num_requests[i->block].peers.push_back(&p);
}
for (std::vector<pending_block>::const_iterator i = p.download_queue().begin()
, end(p.download_queue().end()); i != end; ++i)
@ -5238,7 +5238,7 @@ namespace libtorrent
if (!i->not_wanted && !i->timed_out) ++num_requests[i->block].num_peers;
if (i->timed_out) ++num_requests[i->block].num_peers_with_timeouts;
if (i->not_wanted) ++num_requests[i->block].num_peers_with_nowant;
num_requests[i->block].peers.push_back(&p);
// num_requests[i->block].peers.push_back(&p);
}
}
for (std::map<piece_block, peer_count_t>::iterator i = num_requests.begin()