Skip to content

Commit 96b7fc2

Browse files
fix: Correct comment explenation
1 parent 6a372e4 commit 96b7fc2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Src/HALAL/Services/Time/Scheduler.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,12 @@ void Scheduler::remove_sorted(uint8_t id) {
222222

223223
if(matches == 0) [[unlikely]] return; // not found
224224

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+
*/
225228
uint32_t pos_msb = __builtin_ctzll(matches);
226229
uint32_t pos_lsb = pos_msb - 3;
227230

228-
// convert pos_lsb to 0x0..0_FFF_0..0
229231
uint64_t mask = (1ULL << pos_lsb) - 1;
230232

231233
// Remove element (lower part | higher pushing nibble out of mask)

0 commit comments

Comments
 (0)