From c9b73247e02a46e334f173cbc44e81ca7887bc3e Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 23 Nov 2025 21:37:43 +0000 Subject: [PATCH] Codefix: Remove this-> from static call to CleaningPool. (#14817) Don't call unnecessarily. --- src/economy.cpp | 2 +- src/roadstop.cpp | 2 -- src/story.cpp | 8 ++++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/economy.cpp b/src/economy.cpp index d61372de7e..67d9873c28 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1181,7 +1181,7 @@ CargoPayment::CargoPayment(Vehicle *front) : CargoPayment::~CargoPayment() { - if (this->CleaningPool()) return; + if (CleaningPool()) return; this->front->cargo_payment = nullptr; diff --git a/src/roadstop.cpp b/src/roadstop.cpp index cd9a3b1152..fa89cd4ce9 100644 --- a/src/roadstop.cpp +++ b/src/roadstop.cpp @@ -30,8 +30,6 @@ RoadStop::~RoadStop() if (this->status.Test(RoadStopStatusFlag::BaseEntry)) { delete this->entries; } - - if (CleaningPool()) return; } /** diff --git a/src/story.cpp b/src/story.cpp index 89a2474811..18af96767e 100644 --- a/src/story.cpp +++ b/src/story.cpp @@ -39,10 +39,10 @@ INSTANTIATE_POOL_METHODS(StoryPage) StoryPage::~StoryPage() { - if (!this->CleaningPool()) { - for (StoryPageElement *spe : StoryPageElement::Iterate()) { - if (spe->page == this->index) delete spe; - } + if (CleaningPool()) return; + + for (StoryPageElement *spe : StoryPageElement::Iterate()) { + if (spe->page == this->index) delete spe; } }