From 7b7e00123e30eeb1ca8ea18740f622df1c9db2fc Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Thu, 13 Jun 2024 19:09:36 +0100 Subject: [PATCH] Codechange: Shuffle RoadStop members to reduce size. Size is reduced from 40 bytes to 32 bytes on 64 bit platforms. --- src/roadstop_base.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/roadstop_base.h b/src/roadstop_base.h index 6bd3c268d8..1213773646 100644 --- a/src/roadstop_base.h +++ b/src/roadstop_base.h @@ -64,14 +64,14 @@ struct RoadStop : RoadStopPool::PoolItem<&_roadstop_pool> { void Rebuild(const RoadStop *rs, int side = -1); }; - TileIndex xy; ///< Position on the map - uint8_t status; ///< Current status of the Stop, @see RoadStopSatusFlag. Access using *Bay and *Busy functions. - struct RoadStop *next; ///< Next stop of the given type at this station + uint8_t status; ///< Current status of the Stop, @see RoadStopSatusFlag. Access using *Bay and *Busy functions. + TileIndex xy; ///< Position on the map + RoadStop *next; ///< Next stop of the given type at this station /** Initializes a RoadStop */ inline RoadStop(TileIndex tile = INVALID_TILE) : - xy(tile), - status((1 << RSSFB_BAY_COUNT) - 1) + status((1 << RSSFB_BAY_COUNT) - 1), + xy(tile) { } ~RoadStop();