diff --git a/include/libtorrent/ip_filter.hpp b/include/libtorrent/ip_filter.hpp index c3fb0c4c8..e2ab1d401 100644 --- a/include/libtorrent/ip_filter.hpp +++ b/include/libtorrent/ip_filter.hpp @@ -171,7 +171,9 @@ namespace detail { if (i != j) m_access_list.erase(std::next(i), j); if (i->start == first) { - // we can do this const-cast because we know that the new + // This is an optimization over erasing and inserting a new element + // here. + // this const-cast is OK because we know that the new // start address will keep the set correctly ordered const_cast(i->start) = first; const_cast(i->access) = flags; diff --git a/include/libtorrent/kademlia/dht_tracker.hpp b/include/libtorrent/kademlia/dht_tracker.hpp index 16c32dd9c..c52d7e93b 100644 --- a/include/libtorrent/kademlia/dht_tracker.hpp +++ b/include/libtorrent/kademlia/dht_tracker.hpp @@ -171,8 +171,8 @@ namespace libtorrent { namespace dht { node* get_node(node_id const& id, std::string const& family_name); // implements socket_manager - virtual bool has_quota() override; - virtual bool send_packet(aux::listen_socket_handle const& s, entry& e, udp::endpoint const& addr) override; + bool has_quota() override; + bool send_packet(aux::listen_socket_handle const& s, entry& e, udp::endpoint const& addr) override; // this is the bdecode_node DHT messages are parsed into. It's a member // in order to avoid having to deallocate and re-allocate it for every diff --git a/src/torrent.cpp b/src/torrent.cpp index d1189a186..a49377947 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -6710,7 +6710,7 @@ namespace libtorrent { { bool const lhs_connecting = lhs->is_connecting() && !lhs->is_disconnecting(); bool const rhs_connecting = rhs->is_connecting() && !rhs->is_disconnecting(); - if (lhs_connecting != rhs_connecting) return (lhs_connecting < rhs_connecting); + if (lhs_connecting != rhs_connecting) return (int(lhs_connecting) < int(rhs_connecting)); // a lower value of connected_time means it's been waiting // longer. This is a less-than comparison, so if lhs has