forked from premiere/premiere-libtorrent
iterator fixes (to avoid triggering safe iterator asserts)
This commit is contained in:
parent
5ff6708b3d
commit
365b8c07c6
|
@ -222,10 +222,13 @@ struct bandwidth_manager
|
|||
TORRENT_ASSERT(current_quota == m_current_quota);
|
||||
|
||||
typename queue_t::const_iterator j = m_queue.begin();
|
||||
++j;
|
||||
for (typename queue_t::const_iterator i = m_queue.begin()
|
||||
, end(m_queue.end()); i != end && j != end; ++i, ++j)
|
||||
TORRENT_ASSERT(i->priority >= j->priority);
|
||||
if (j != m_queue.end())
|
||||
{
|
||||
++j;
|
||||
for (typename queue_t::const_iterator i = m_queue.begin()
|
||||
, end(m_queue.end()); i != end && j != end; ++i, ++j)
|
||||
TORRENT_ASSERT(i->priority >= j->priority);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -2681,6 +2681,7 @@ namespace libtorrent
|
|||
for (int c = 0; c < 2; ++c)
|
||||
{
|
||||
queue_t::const_iterator j = m_bandwidth_queue[c].begin();
|
||||
if (j == m_bandwidth_queue[c].end()) continue;
|
||||
++j;
|
||||
for (queue_t::const_iterator i = m_bandwidth_queue[c].begin()
|
||||
, end(m_bandwidth_queue[c].end()); i != end && j != end; ++i, ++j)
|
||||
|
|
Loading…
Reference in New Issue