Codechange: Redundant use of char * and c_str(). (#11454)

This commit is contained in:
Peter Nelson
2023-11-10 00:17:36 +00:00
committed by GitHub
parent 938c8339d2
commit 1071acb483
6 changed files with 11 additions and 11 deletions

View File

@@ -125,11 +125,11 @@ struct BaseStation : StationPool::PoolItem<&_station_pool> {
*/
virtual void UpdateVirtCoord() = 0;
inline const char *GetCachedName() const
inline const std::string &GetCachedName() const
{
if (!this->name.empty()) return this->name.c_str();
if (!this->name.empty()) return this->name;
if (this->cached_name.empty()) this->FillCachedName();
return this->cached_name.c_str();
return this->cached_name;
}
virtual void MoveSign(TileIndex new_xy)