void print_bitfield(bitfield const& b) { std::string out; out.reserve(b.size()); for (bool bit : b) out += bit ? '1' : '0'; std::printf("%s\n", out.c_str()); }
void print_bitfield(bitfield const& b) { std::string out; for (int i = 0; i < b.size(); ++i) { out += b.get_bit(i) ? "1" : "0"; } std::printf("%s\n", out.c_str()); }
void peer_lost(bitfield const& bits, peer_connection const* peer) { if (has_picker()) { if (bits.all_set() && bits.size() > 0) m_picker->dec_refcount_all(peer); else m_picker->dec_refcount(bits, peer); } #ifdef TORRENT_DEBUG else { TORRENT_ASSERT(is_seed()); } #endif }
bitfield(bitfield const& rhs) { assign(rhs.data(), rhs.size()); }