Codechange: remove a number of unneeded c_str() calls

This commit is contained in:
Rubidium
2023-06-15 19:15:08 +02:00
committed by rubidium42
parent aae8f40b9f
commit d4c2043294
12 changed files with 19 additions and 20 deletions

View File

@@ -455,7 +455,7 @@ public:
/* Measure the accepted cargoes, if any. */
GetAllCargoSuffixes(CARGOSUFFIX_IN, CST_FUND, nullptr, indtype, indsp, indsp->accepts_cargo, cargo_suffix);
std::string cargostring = this->MakeCargoListString(indsp->accepts_cargo, cargo_suffix, lengthof(indsp->accepts_cargo), STR_INDUSTRY_VIEW_REQUIRES_N_CARGO);
Dimension strdim = GetStringBoundingBox(cargostring.c_str());
Dimension strdim = GetStringBoundingBox(cargostring);
if (strdim.width > max_minwidth) {
extra_lines_req = std::max(extra_lines_req, strdim.width / max_minwidth + 1);
strdim.width = max_minwidth;
@@ -465,7 +465,7 @@ public:
/* Measure the produced cargoes, if any. */
GetAllCargoSuffixes(CARGOSUFFIX_OUT, CST_FUND, nullptr, indtype, indsp, indsp->produced_cargo, cargo_suffix);
cargostring = this->MakeCargoListString(indsp->produced_cargo, cargo_suffix, lengthof(indsp->produced_cargo), STR_INDUSTRY_VIEW_PRODUCES_N_CARGO);
strdim = GetStringBoundingBox(cargostring.c_str());
strdim = GetStringBoundingBox(cargostring);
if (strdim.width > max_minwidth) {
extra_lines_prd = std::max(extra_lines_prd, strdim.width / max_minwidth + 1);
strdim.width = max_minwidth;