mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Apply suggestions from code review
parent
2dd2b698d2
commit
921f5afc4d
|
@ -207,7 +207,7 @@ void Town::InitializeLayout(TownLayout layout)
|
||||||
|
|
||||||
void Town::FillCachedName() const
|
void Town::FillCachedName() const
|
||||||
{
|
{
|
||||||
this->cached_name.assign(GetTownName(this));
|
this->cached_name = GetTownName(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -116,7 +116,11 @@ bool VerifyTownName(uint32 r, const TownNameParams *par, TownNames *town_names)
|
||||||
for (const Town *t : Town::Iterate()) {
|
for (const Town *t : Town::Iterate()) {
|
||||||
/* We can't just compare the numbers since
|
/* We can't just compare the numbers since
|
||||||
* several numbers may map to a single name. */
|
* several numbers may map to a single name. */
|
||||||
if (name == (t->name.empty() ? GetTownName(t) : t->name)) return false;
|
if (t->name.empty()) {
|
||||||
|
if (name == GetTownName(t)) return false;
|
||||||
|
} else {
|
||||||
|
if (name == t->name) return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue