We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6a372e4 commit 96b7fc2Copy full SHA for 96b7fc2
1 file changed
Src/HALAL/Services/Time/Scheduler.cpp
@@ -222,10 +222,12 @@ void Scheduler::remove_sorted(uint8_t id) {
222
223
if(matches == 0) [[unlikely]] return; // not found
224
225
+ /* split the bm in two 0x0000...FFFFFF where removal index is placed
226
+ * then invert to keep both sides that surround the discarded index
227
+ */
228
uint32_t pos_msb = __builtin_ctzll(matches);
229
uint32_t pos_lsb = pos_msb - 3;
230
- // convert pos_lsb to 0x0..0_FFF_0..0
231
uint64_t mask = (1ULL << pos_lsb) - 1;
232
233
// Remove element (lower part | higher pushing nibble out of mask)
0 commit comments