minimal optimization by using node_id::is_all_zero
This commit is contained in:
parent
448de4ca14
commit
135e47c929
|
@ -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;
|
||||||
|
|
|
@ -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)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue