From ac9db3f5aad82b91430556eee1bbef8b42cb9d4e Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Mon, 9 Oct 2023 13:11:55 +0100 Subject: [PATCH] Codechange: Don't use bit-field in Yapf rail node. (#11362) Compacting 3 booleans into 3 bits could save memory allocation, however this data is inside a union which also contains a 4-byte integer. As such this gives the cost penalty of a bit-field without any benefit. --- src/pathfinder/yapf/yapf_node_rail.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pathfinder/yapf/yapf_node_rail.hpp b/src/pathfinder/yapf/yapf_node_rail.hpp index 16027d06e5..cecaaa95c4 100644 --- a/src/pathfinder/yapf/yapf_node_rail.hpp +++ b/src/pathfinder/yapf/yapf_node_rail.hpp @@ -127,9 +127,9 @@ struct CYapfRailNodeT union { uint32_t m_inherited_flags; struct { - bool m_targed_seen : 1; - bool m_choice_seen : 1; - bool m_last_signal_was_red : 1; + bool m_targed_seen; + bool m_choice_seen; + bool m_last_signal_was_red; } flags_s; } flags_u; SignalType m_last_red_signal_type;