From d0f077f3c0dfdadf36ef4c273368ae18bb9e8ed2 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 5 Dec 2024 13:31:52 +0300 Subject: [PATCH] Clear flags immediately instead of at the scope exit. --- td/telegram/StarManager.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/td/telegram/StarManager.cpp b/td/telegram/StarManager.cpp index 34680f72476c..f0c9249248dc 100644 --- a/td/telegram/StarManager.cpp +++ b/td/telegram/StarManager.cpp @@ -334,15 +334,11 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler { transaction->transaction_url_); } if (transaction->pending_) { - SCOPE_EXIT { - transaction->pending_ = false; - }; + transaction->pending_ = false; return td_api::make_object(); } if (transaction->failed_) { - SCOPE_EXIT { - transaction->failed_ = false; - }; + transaction->failed_ = false; return td_api::make_object(); } return nullptr; @@ -444,9 +440,7 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler { } if (transaction->reaction_) { if (for_channel) { - SCOPE_EXIT { - transaction->reaction_ = false; - }; + transaction->reaction_ = false; return td_api::make_object( user_id_object, get_message_id_object()); }