Changeset - r24112:408bc46a0f12
[Not reviewed]
master
0 3 0
Quipyowert2 - 5 years ago 2020-02-17 01:57:22
38995150+Quipyowert2@users.noreply.github.com
Codechange: Avoid copying function parameters by using const references
3 files changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/ai/ai_gui.cpp
Show inline comments
 
@@ -589,7 +589,7 @@ struct AISettingsWindow : public Window 
 
	}
 

	
 
private:
 
	bool IsEditableItem(const ScriptConfigItem config_item) const
 
	bool IsEditableItem(const ScriptConfigItem &config_item) const
 
	{
 
		return _game_mode == GM_MENU || ((this->slot != OWNER_DEITY) && !Company::IsValidID(this->slot)) || (config_item.flags & SCRIPTCONFIG_INGAME) != 0;
 
	}
src/company_cmd.cpp
Show inline comments
 
@@ -208,7 +208,7 @@ bool CheckCompanyHasMoney(CommandCost &c
 
 * @param c Company to pay the bill.
 
 * @param cost Money to pay.
 
 */
 
static void SubtractMoneyFromAnyCompany(Company *c, CommandCost cost)
 
static void SubtractMoneyFromAnyCompany(Company *c, const CommandCost &cost)
 
{
 
	if (cost.GetCost() == 0) return;
 
	assert(cost.GetExpensesType() != INVALID_EXPENSES);
 
@@ -237,7 +237,7 @@ static void SubtractMoneyFromAnyCompany(
 
 * Subtract money from the #_current_company, if the company is valid.
 
 * @param cost Money to pay.
 
 */
 
void SubtractMoneyFromCompany(CommandCost cost)
 
void SubtractMoneyFromCompany(const CommandCost &cost)
 
{
 
	Company *c = Company::GetIfValid(_current_company);
 
	if (c != nullptr) SubtractMoneyFromAnyCompany(c, cost);
 
@@ -248,7 +248,7 @@ void SubtractMoneyFromCompany(CommandCos
 
 * @param company Company paying the bill.
 
 * @param cst     Cost of a command.
 
 */
 
void SubtractMoneyFromCompanyFract(CompanyID company, CommandCost cst)
 
void SubtractMoneyFromCompanyFract(CompanyID company, const CommandCost &cst)
 
{
 
	Company *c = Company::Get(company);
 
	byte m = c->money_fraction;
src/company_func.h
Show inline comments
 
@@ -25,8 +25,8 @@ void CompanyAdminBankrupt(CompanyID comp
 
void UpdateLandscapingLimits();
 

	
 
bool CheckCompanyHasMoney(CommandCost &cost);
 
void SubtractMoneyFromCompany(CommandCost cost);
 
void SubtractMoneyFromCompanyFract(CompanyID company, CommandCost cost);
 
void SubtractMoneyFromCompany(const CommandCost& cost);
 
void SubtractMoneyFromCompanyFract(CompanyID company, const CommandCost& cost);
 
CommandCost CheckOwnership(Owner owner, TileIndex tile = 0);
 
CommandCost CheckTileOwnership(TileIndex tile);
 

	
0 comments (0 inline, 0 general)