removed too expensive invariant checks

This commit is contained in:
Arvid Norberg 2007-08-21 19:18:06 +00:00
parent 847f96d9c3
commit e074b0a977
2 changed files with 8 additions and 4 deletions

View File

@ -1370,7 +1370,8 @@ namespace libtorrent
#ifndef NDEBUG #ifndef NDEBUG
bool policy::has_connection(const peer_connection* c) bool policy::has_connection(const peer_connection* c)
{ {
INVARIANT_CHECK; // too expensive
// INVARIANT_CHECK;
assert(c); assert(c);
try { assert(c->remote() == c->get_socket()->remote_endpoint()); } try { assert(c->remote() == c->get_socket()->remote_endpoint()); }

View File

@ -809,7 +809,8 @@ namespace detail
{ {
mutex_t::scoped_lock l(m_mutex); mutex_t::scoped_lock l(m_mutex);
INVARIANT_CHECK; // too expensive
// INVARIANT_CHECK;
connection_map::iterator p = m_connections.find(s); connection_map::iterator p = m_connections.find(s);
@ -841,7 +842,8 @@ namespace detail
{ {
mutex_t::scoped_lock l(m_mutex); mutex_t::scoped_lock l(m_mutex);
INVARIANT_CHECK; // too expensive
// INVARIANT_CHECK;
assert(p->is_disconnecting()); assert(p->is_disconnecting());
connection_map::iterator i = m_connections.find(p->get_socket()); connection_map::iterator i = m_connections.find(p->get_socket());
@ -2067,7 +2069,8 @@ namespace detail
{ {
mutex_t::scoped_lock l(m_mutex); mutex_t::scoped_lock l(m_mutex);
INVARIANT_CHECK; // too expensive
// INVARIANT_CHECK;
if (m_alerts.pending()) if (m_alerts.pending())
return m_alerts.get(); return m_alerts.get();