From c4ca6a0f74b2e8f8e7af703758965289f4e5b6c0 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Thu, 4 May 2023 10:39:22 +0100 Subject: [PATCH] Codechange: Rename IsCargo..Valid to IsValidCargo.. This better fits our naming pattern for this type of function. --- src/cargo_type.h | 4 ++-- src/industry_gui.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cargo_type.h b/src/cargo_type.h index 3122d54102..561091f42d 100644 --- a/src/cargo_type.h +++ b/src/cargo_type.h @@ -70,9 +70,9 @@ enum CargoType { }; /** Test whether cargo type is not CT_INVALID */ -inline bool IsCargoTypeValid(CargoType t) { return t != CT_INVALID; } +inline bool IsValidCargoType(CargoType t) { return t != CT_INVALID; } /** Test whether cargo type is not CT_INVALID */ -inline bool IsCargoIDValid(CargoID t) { return t != CT_INVALID; } +inline bool IsValidCargoID(CargoID t) { return t != CT_INVALID; } typedef uint64 CargoTypes; diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 52110634ab..32c040845a 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -2527,8 +2527,8 @@ struct IndustryCargoesWindow : public Window { const IndustrySpec *indsp = GetIndustrySpec(it); if (!indsp->enabled) continue; this->ind_textsize = maxdim(this->ind_textsize, GetStringBoundingBox(indsp->name)); - CargoesField::max_cargoes = std::max(CargoesField::max_cargoes, std::count_if(indsp->accepts_cargo, endof(indsp->accepts_cargo), IsCargoIDValid)); - CargoesField::max_cargoes = std::max(CargoesField::max_cargoes, std::count_if(indsp->produced_cargo, endof(indsp->produced_cargo), IsCargoIDValid)); + CargoesField::max_cargoes = std::max(CargoesField::max_cargoes, std::count_if(indsp->accepts_cargo, endof(indsp->accepts_cargo), IsValidCargoID)); + CargoesField::max_cargoes = std::max(CargoesField::max_cargoes, std::count_if(indsp->produced_cargo, endof(indsp->produced_cargo), IsValidCargoID)); } d.width = std::max(d.width, this->ind_textsize.width); d.height = this->ind_textsize.height;