From 8ff6562b2f0cf869f8620d52e58dd99c28254bba Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sat, 4 Nov 2023 14:33:18 +0000 Subject: [PATCH] Codechange: Reduce variable scope. --- src/industry_gui.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 40c602b446..c7a826a020 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -1669,16 +1669,15 @@ public: break; case WID_ID_INDUSTRY_LIST: { - int n = 0; Rect ir = r.Shrink(WidgetDimensions::scaled.framerect); if (this->industries.empty()) { DrawString(ir, STR_INDUSTRY_DIRECTORY_NONE); break; } - TextColour tc; + int n = 0; const CargoID acf_cid = this->cargo_filter[this->accepted_cargo_filter_criteria]; for (uint i = this->vscroll->GetPosition(); i < this->industries.size(); i++) { - tc = TC_FROMSTRING; + TextColour tc = TC_FROMSTRING; if (acf_cid != CF_ANY && acf_cid != CF_NONE) { Industry *ind = const_cast(this->industries[i]); if (IndustryTemporarilyRefusesCargo(ind, acf_cid)) {