Fixed lfsr_o_isbshrub falling out-of-date

In hindsight this was way too fragile.

Explicitly checking for both LFS_TYPE_REG and LFS_type_TRAVERSAL (the 2
in-device types that can have attached bshrubs) solves this and
hopefully prevents lfsr_o_isbshrub from falling out-of-date in the
future.

The downside being a little bit more code:

           code          stack          ctx
  before: 35832           2440          640
  after:  35864 (+0.1%)   2440 (+0.0%)  640 (+0.0%)

Found by test_traversal_mutation_mroot_split_bshrub_l and
test_traversal_mutation_mroot_split_bshrub_r.
This commit is contained in:
Christopher Haster
2025-04-24 15:24:44 -05:00
parent f3cd9802b8
commit 89cb740e1c
+2 -2
View File
@@ -6890,8 +6890,8 @@ static inline uint32_t lfsr_o_settype(uint32_t flags, uint8_t type) {
} }
static inline bool lfsr_o_isbshrub(uint32_t flags) { static inline bool lfsr_o_isbshrub(uint32_t flags) {
// it turns out that bshrub types share a bit return lfsr_o_type(flags) == LFS_TYPE_REG
return flags & 0x10000000; || lfsr_o_type(flags) == LFS_type_TRAVERSAL;
} }
static inline bool lfsr_o_isunflush(uint32_t flags) { static inline bool lfsr_o_isunflush(uint32_t flags) {