Codechange: use std::string without const as return

Otherwise some compilers, e.g. MSVC, do not pick up that these are temporaries
and as such it will pass the temporaries to `const std::string &` instead of
the wanted `std::string &&`
This commit is contained in:
Rubidium
2023-07-03 16:22:15 +02:00
committed by rubidium42
parent b2edf82b69
commit 78f5d58dc6
5 changed files with 15 additions and 15 deletions

View File

@@ -26,7 +26,7 @@
EnforceDeityMode(false);
EnforcePrecondition(false, text != nullptr);
const std::string &encoded = text->GetEncodedText();
std::string encoded = text->GetEncodedText();
EnforcePreconditionEncodedText(false, encoded);
EnforcePrecondition(false, type == NT_ECONOMY || type == NT_SUBSIDIES || type == NT_GENERAL);
EnforcePrecondition(false, company == ScriptCompany::COMPANY_INVALID || ScriptCompany::ResolveCompanyID(company) != ScriptCompany::COMPANY_INVALID);