From 0eb578e4219ee67499d7a32ac9a3a28d3253057e Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Wed, 27 Mar 2024 13:01:15 -0500 Subject: [PATCH] Avoid unused http variable by accessing it where needed. --- plugins/producer_api_plugin/producer_api_plugin.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/producer_api_plugin/producer_api_plugin.cpp b/plugins/producer_api_plugin/producer_api_plugin.cpp index 1795923457..6f86fdd3a6 100644 --- a/plugins/producer_api_plugin/producer_api_plugin.cpp +++ b/plugins/producer_api_plugin/producer_api_plugin.cpp @@ -23,8 +23,7 @@ using namespace eosio; #define CALL_WITH_400(api_name, category, api_handle, call_name, INVOKE, http_response_code) \ {std::string("/v1/" #api_name "/" #call_name), \ api_category::category, \ - [&http, &producer](string&&, string&& body, url_response_callback&& cb) mutable { \ - (void)&http; (void)&producer; \ + [&producer](string&&, string&& body, url_response_callback&& cb) mutable { \ try { \ INVOKE \ cb(http_response_code, fc::variant(result)); \ @@ -64,6 +63,7 @@ using namespace eosio; auto result = api_handle.call_name(std::move(params)); #define INVOKE_R_R_D(api_handle, call_name, in_param) \ + auto& http = app().get_plugin(); \ const fc::microseconds http_max_response_time = http.get_max_response_time(); \ auto deadline = http_max_response_time == fc::microseconds::maximum() ? fc::time_point::maximum() \ : fc::time_point::now() + http_max_response_time; \ @@ -92,7 +92,6 @@ void producer_api_plugin::plugin_startup() { ilog("starting producer_api_plugin"); // lifetime of plugin is lifetime of application auto& producer = app().get_plugin(); - auto& http = app().get_plugin(); app().get_plugin().add_api({ CALL_WITH_400(producer, producer_ro, producer, paused,