fix operator() ==, add const (#2063)

This commit is contained in:
Pavel Pimenov 2017-06-10 09:18:32 +03:00 committed by Arvid Norberg
parent f3d319b677
commit de369451b1
3 changed files with 4 additions and 4 deletions

View File

@ -199,7 +199,7 @@ namespace aux {
void* get_storage() const { return storage.get(); } void* get_storage() const { return storage.get(); }
bool operator==(cached_piece_entry const& rhs) const bool operator==(cached_piece_entry const& rhs) const
{ return storage.get() == rhs.storage.get() && piece == rhs.piece; } { return piece == rhs.piece && storage.get() == rhs.storage.get(); }
// if this is set, we'll be calculating the hash // if this is set, we'll be calculating the hash
// for this piece. This member stores the interim // for this piece. This member stores the interim

View File

@ -124,7 +124,7 @@ namespace aux {
// busy request at a time in each peer's queue // busy request at a time in each peer's queue
std::uint32_t busy:1; std::uint32_t busy:1;
bool operator==(pending_block const& b) bool operator==(pending_block const& b) const
{ {
return b.block == block return b.block == block
&& b.not_wanted == not_wanted && b.not_wanted == not_wanted

View File

@ -643,10 +643,10 @@ namespace libtorrent {
* prio_factor + adjustment; * prio_factor + adjustment;
} }
bool operator!=(piece_pos p) const bool operator!=(piece_pos const& p) const
{ return index != p.index || peer_count != p.peer_count; } { return index != p.index || peer_count != p.peer_count; }
bool operator==(piece_pos p) const bool operator==(piece_pos const& p) const
{ return index == p.index && peer_count == p.peer_count; } { return index == p.index && peer_count == p.peer_count; }
}; };