Codechange: Shuffle OrderList members to reduce size.

Size is reduced from 40 bytes to 32 bytes on 64 bit platforms.
This commit is contained in:
Peter Nelson 2024-06-13 19:06:19 +01:00 committed by Peter Nelson
parent 219995c643
commit 77f62e0c90

View File

@ -261,11 +261,11 @@ private:
friend void AfterLoadVehicles(bool part_of_load); ///< For instantiating the shared vehicle chain friend void AfterLoadVehicles(bool part_of_load); ///< For instantiating the shared vehicle chain
friend SaveLoadTable GetOrderListDescription(); ///< Saving and loading of order lists. friend SaveLoadTable GetOrderListDescription(); ///< Saving and loading of order lists.
Order *first; ///< First order of the order list.
VehicleOrderID num_orders; ///< NOSAVE: How many orders there are in the list. VehicleOrderID num_orders; ///< NOSAVE: How many orders there are in the list.
VehicleOrderID num_manual_orders; ///< NOSAVE: How many manually added orders are there in the list. VehicleOrderID num_manual_orders; ///< NOSAVE: How many manually added orders are there in the list.
uint num_vehicles; ///< NOSAVE: Number of vehicles that share this order list. uint num_vehicles; ///< NOSAVE: Number of vehicles that share this order list.
Vehicle *first_shared; ///< NOSAVE: pointer to the first vehicle in the shared order chain. Vehicle *first_shared; ///< NOSAVE: pointer to the first vehicle in the shared order chain.
Order *first; ///< First order of the order list.
TimerGameTick::Ticks timetable_duration; ///< NOSAVE: Total timetabled duration of the order list. TimerGameTick::Ticks timetable_duration; ///< NOSAVE: Total timetabled duration of the order list.
TimerGameTick::Ticks total_duration; ///< NOSAVE: Total (timetabled or not) duration of the order list. TimerGameTick::Ticks total_duration; ///< NOSAVE: Total (timetabled or not) duration of the order list.
@ -273,7 +273,7 @@ private:
public: public:
/** Default constructor producing an invalid order list. */ /** Default constructor producing an invalid order list. */
OrderList(VehicleOrderID num_orders = INVALID_VEH_ORDER_ID) OrderList(VehicleOrderID num_orders = INVALID_VEH_ORDER_ID)
: first(nullptr), num_orders(num_orders), num_manual_orders(0), num_vehicles(0), first_shared(nullptr), : num_orders(num_orders), num_manual_orders(0), num_vehicles(0), first_shared(nullptr), first(nullptr),
timetable_duration(0), total_duration(0) { } timetable_duration(0), total_duration(0) { }
/** /**