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

@@ -15,6 +15,7 @@
#include "viewport_type.h"
#include "station_map.h"
#include "core/geometry_type.hpp"
#include "core/tinystring_type.hpp"
#include <memory>
typedef Pool<BaseStation, StationID, 32, 64000> StationPool;
@@ -56,7 +57,7 @@ struct BaseStation : StationPool::PoolItem<&_station_pool> {
TrackedViewportSign sign; ///< NOSAVE: Dimensions of sign
byte delete_ctr; ///< Delete counter. If greater than 0 then it is decremented until it reaches 0; the waypoint is then is deleted.
std::string name; ///< Custom name
TinyString name; ///< Custom name
StringID string_id; ///< Default name (town area) of station
mutable std::string cached_name; ///< NOSAVE: Cache of the resolved name of the station, if not using a custom name