minimal optimization by using node_id::is_all_zero

This commit is contained in:
Alden Torres 2018-03-04 13:28:31 -05:00 committed by Arvid Norberg
parent 448de4ca14
commit 135e47c929
2 changed files with 2 additions and 2 deletions

View File

@ -85,7 +85,7 @@ node_id calculate_node_id(node_id const& nid, aux::listen_socket_handle const& s
return generate_random_id(); return generate_random_id();
} }
if (nid == node_id::min() || !verify_id(nid, external_address)) if (nid.is_all_zeros() || !verify_id(nid, external_address))
return generate_id(external_address); return generate_id(external_address);
return nid; return nid;

View File

@ -39,7 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
namespace libtorrent { namespace dht { namespace libtorrent { namespace dht {
put_data::put_data(node& dht_node, put_callback const& callback) put_data::put_data(node& dht_node, put_callback const& callback)
: traversal_algorithm(dht_node, (node_id::min)()) : traversal_algorithm(dht_node, {})
, m_put_callback(callback) , m_put_callback(callback)
{} {}