mirror of https://github.com/OpenTTD/OpenTTD.git
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.
This commit is contained in:
parent
84201a8520
commit
ac9db3f5aa
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue