cleanup: Changes for c++17

This cleanup adjusts the rTorrent code to comply with c++17 standard. It also simplifies various parts of the code.
This commit is contained in:
stickz
2025-01-15 13:27:35 -05:00
committed by Jari Sundell
parent 2e0a417367
commit e7fc891f11
14 changed files with 29 additions and 34 deletions
+1 -2
View File
@@ -99,8 +99,7 @@ apply_dht_add_node(const std::string& arg) {
torrent::Object
apply_enable_trackers(int64_t arg) {
for (core::Manager::DListItr itr = control->core()->download_list()->begin(), last = control->core()->download_list()->end(); itr != last; ++itr) {
std::for_each((*itr)->tracker_list()->begin(), (*itr)->tracker_list()->end(),
arg ? std::mem_fun(&torrent::Tracker::enable) : std::mem_fun(&torrent::Tracker::disable));
std::for_each((*itr)->tracker_list()->begin(), (*itr)->tracker_list()->end(), std::mem_fn(arg ? &torrent::Tracker::enable : &torrent::Tracker::disable));
if (arg && !rpc::call_command_value("trackers.use_udp"))
(*itr)->enable_udp_trackers(false);