forked from premiere/premiere-libtorrent
make clear_read_cache() code less confusing
This commit is contained in:
parent
00e0c7be9c
commit
a1dbba7cf4
|
@ -2048,12 +2048,14 @@ namespace libtorrent
|
||||||
|
|
||||||
tailqueue jobs;
|
tailqueue jobs;
|
||||||
boost::unordered_set<cached_piece_entry*> const& cache = storage->cached_pieces();
|
boost::unordered_set<cached_piece_entry*> const& cache = storage->cached_pieces();
|
||||||
|
|
||||||
|
// note that i is incremented in the body!
|
||||||
for (boost::unordered_set<cached_piece_entry*>::const_iterator i = cache.begin()
|
for (boost::unordered_set<cached_piece_entry*>::const_iterator i = cache.begin()
|
||||||
, end(cache.end()); i != end; ++i)
|
, end(cache.end()); i != end; )
|
||||||
{
|
{
|
||||||
tailqueue temp;
|
tailqueue temp;
|
||||||
m_disk_cache.evict_piece(*(i++), temp);
|
if (m_disk_cache.evict_piece(*(i++), temp))
|
||||||
jobs.append(temp);
|
jobs.append(temp);
|
||||||
}
|
}
|
||||||
fail_jobs(storage_error(boost::asio::error::operation_aborted), jobs);
|
fail_jobs(storage_error(boost::asio::error::operation_aborted), jobs);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue