From c63db9cf9753baf70737e397cb53e8908e990324 Mon Sep 17 00:00:00 2001 From: trim21 Date: Tue, 9 Jun 2026 17:59:55 +0800 Subject: [PATCH] refactor: use torrent::heuristics_enum instead of choke_queue::heuristics_enum Update to use the new top-level torrent::heuristics_enum from torrent/download/types.h, removing the dependency on choke_queue.h for enum values. --- src/command_download.cc | 4 ++-- src/command_groups.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/command_download.cc b/src/command_download.cc index 0c2c67eb..d87454bc 100644 --- a/src/command_download.cc +++ b/src/command_download.cc @@ -164,8 +164,8 @@ apply_d_connection_type(core::Download* download, const std::string& name) { torrent::Object apply_d_choke_heuristics(core::Download* download, const std::string& name, bool is_down) { - torrent::Download::HeuristicType t = - (torrent::Download::HeuristicType)torrent::option_find_string(torrent::OPTION_CHOKE_HEURISTICS, name.c_str()); + torrent::heuristics_enum t = + static_cast(torrent::option_find_string(torrent::OPTION_CHOKE_HEURISTICS, name.c_str())); if (is_down) download->download()->set_download_choke_heuristic(t); diff --git a/src/command_groups.cc b/src/command_groups.cc index 645058fb..4e3a0c71 100644 --- a/src/command_groups.cc +++ b/src/command_groups.cc @@ -186,8 +186,8 @@ apply_cg_insert(const std::string& arg) { cg_list_hack.push_back(new torrent::choke_group()); cg_list_hack.back()->set_name(arg); - cg_list_hack.back()->up_queue()->set_heuristics(torrent::choke_queue::HEURISTICS_UPLOAD_LEECH); - cg_list_hack.back()->down_queue()->set_heuristics(torrent::choke_queue::HEURISTICS_DOWNLOAD_LEECH); + cg_list_hack.back()->up_queue()->set_heuristics(torrent::HEURISTICS_UPLOAD_LEECH); + cg_list_hack.back()->down_queue()->set_heuristics(torrent::HEURISTICS_DOWNLOAD_LEECH); return torrent::Object(); }