fixed bug introduced when trying to fix a warning of shadowing variables

This commit is contained in:
Arvid Norberg 2011-04-02 19:54:30 +00:00
parent 35d2354c38
commit 56ab4db2e7
1 changed files with 4 additions and 4 deletions

View File

@ -1605,12 +1605,12 @@ namespace libtorrent
{ {
unsigned char bits = bitmask[k]; unsigned char bits = bitmask[k];
int num_bits = (std::min)(num_blocks_per_piece - k*8, 8); int num_bits = (std::min)(num_blocks_per_piece - k*8, 8);
for (int k = 0; k < num_bits; ++k) for (int b = 0; b < num_bits; ++b)
{ {
const int bit = k * 8 + k; const int block = k * 8 + b;
if (bits & (1 << k)) if (bits & (1 << b))
{ {
m_picker->mark_as_finished(piece_block(piece, bit), 0); m_picker->mark_as_finished(piece_block(piece, block), 0);
if (m_picker->is_piece_finished(piece)) if (m_picker->is_piece_finished(piece))
async_verify_piece(piece, boost::bind(&torrent::piece_finished async_verify_piece(piece, boost::bind(&torrent::piece_finished
, shared_from_this(), piece, _1)); , shared_from_this(), piece, _1));