From 77f62e0c90a9b81a791ba62b95e07477d6b68167 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Thu, 13 Jun 2024 19:06:19 +0100 Subject: [PATCH] Codechange: Shuffle OrderList members to reduce size. Size is reduced from 40 bytes to 32 bytes on 64 bit platforms. --- src/order_base.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/order_base.h b/src/order_base.h index 4bdea6140c..8f2f10c252 100644 --- a/src/order_base.h +++ b/src/order_base.h @@ -261,11 +261,11 @@ private: friend void AfterLoadVehicles(bool part_of_load); ///< For instantiating the shared vehicle chain 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_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. 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 total_duration; ///< NOSAVE: Total (timetabled or not) duration of the order list. @@ -273,7 +273,7 @@ private: public: /** Default constructor producing an invalid order list. */ 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) { } /**