diff --git a/include/libtorrent/alert_types.hpp b/include/libtorrent/alert_types.hpp index 53f3f1b31..7deeb75cd 100644 --- a/include/libtorrent/alert_types.hpp +++ b/include/libtorrent/alert_types.hpp @@ -2215,8 +2215,8 @@ namespace libtorrent { // internal dht_stats_alert(aux::stack_allocator& alloc - , std::vector const& table - , std::vector const& requests); + , std::vector table + , std::vector requests); TORRENT_DEFINE_ALERT(dht_stats_alert, 83) diff --git a/src/alert.cpp b/src/alert.cpp index 368af8df9..5fdced139 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -1318,7 +1318,7 @@ namespace libtorrent { state_update_alert::state_update_alert(aux::stack_allocator& , std::vector st) - : status(st) + : status(std::move(st)) {} std::string state_update_alert::message() const @@ -1672,11 +1672,11 @@ namespace libtorrent { } dht_stats_alert::dht_stats_alert(aux::stack_allocator& - , std::vector const& table - , std::vector const& requests) + , std::vector table + , std::vector requests) : alert() - , active_requests(requests) - , routing_table(table) + , active_requests(std::move(requests)) + , routing_table(std::move(table)) {} std::string dht_stats_alert::message() const @@ -1888,7 +1888,7 @@ namespace libtorrent { std::vector p(peers()); v.reserve(p.size()); std::copy(p.begin(), p.end(), std::back_inserter(v)); - } + } #endif std::vector dht_get_peers_reply_alert::peers() const { std::vector peers(m_num_peers); diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 3ac928c60..74f1dc259 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -4523,7 +4523,7 @@ namespace aux { m_posting_torrent_updates = false; #endif - m_alerts.emplace_alert(status); + m_alerts.emplace_alert(std::move(status)); } void session_impl::post_session_stats() @@ -4564,7 +4564,7 @@ namespace aux { m_dht->dht_status(table, requests); #endif - m_alerts.emplace_alert(table, requests); + m_alerts.emplace_alert(std::move(table), std::move(requests)); } std::vector session_impl::get_torrents() const