Use TinyString for custom name fields which are almost always empty

This commit is contained in:
Jonathan G Rennison
2020-05-21 23:50:48 +01:00
parent 81e69fcbbe
commit 5243cfd6d0
14 changed files with 35 additions and 26 deletions

View File

@@ -19,6 +19,7 @@
#include "openttd.h"
#include "table/strings.h"
#include "company_func.h"
#include "core/tinystring_type.hpp"
#include <list>
#include <memory>
@@ -63,7 +64,7 @@ struct Town : TownPool::PoolItem<&_town_pool> {
uint32 townnamegrfid;
uint16 townnametype;
uint32 townnameparts;
std::string name; ///< Custom town name. If empty, the town was not renamed and uses the generated name.
TinyString name; ///< Custom town name. If empty, the town was not renamed and uses the generated name.
mutable std::string cached_name; ///< NOSAVE: Cache of the resolved name of the town, if not using a custom town name
byte flags; ///< See #TownFlags.