minor dht headers code cleanup and lint oriented refactor

This commit is contained in:
Alden Torres 2018-02-13 09:06:53 -05:00 committed by Arvid Norberg
parent fedee2b5fa
commit 670c8a82ad
3 changed files with 4 additions and 14 deletions

View File

@ -40,13 +40,13 @@ namespace libtorrent { namespace dht {
struct direct_traversal : traversal_algorithm
{
typedef std::function<void(dht::msg const&)> message_callback;
using message_callback = std::function<void(dht::msg const&)>;
direct_traversal(node& node
, node_id const& target
, message_callback cb)
: traversal_algorithm(node, target)
, m_cb(cb)
, m_cb(std::move(cb))
{}
char const* name() const override { return "direct_traversal"; }

View File

@ -72,9 +72,9 @@ struct put_data_observer : traversal_observer
{
put_data_observer(
std::shared_ptr<traversal_algorithm> algorithm
, udp::endpoint const& ep, node_id const& id, std::string const& token)
, udp::endpoint const& ep, node_id const& id, std::string token)
: traversal_observer(std::move(algorithm), ep, id)
, m_token(token)
, m_token(std::move(token))
{
}

View File

@ -130,16 +130,6 @@ struct ip_set
// bucket has failed, then it is put in the replacement
// cache (just like in the paper).
namespace impl
{
template <typename F>
inline void forwarder(void* userdata, node_entry const& node)
{
F* f = reinterpret_cast<F*>(userdata);
(*f)(node);
}
}
TORRENT_EXTRA_EXPORT bool compare_ip_cidr(address const& lhs, address const& rhs);
class TORRENT_EXTRA_EXPORT routing_table