Skip to content

Commit a868d6a

Browse files
author
Sun Yu
committed
opt bit rotate operation
1 parent 4673aca commit a868d6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

timeout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ TIMEOUT_PUBLIC void timeouts_update(struct timeouts *T, abstime_t curtime) {
408408
nslot = WHEEL_MASK & (curtime >> (wheel * WHEEL_BIT));
409409
_elapsed = WHEEL_MASK & (WHEEL_LEN + nslot - oslot);
410410

411-
pending = rotr(rotl(((WHEEL_C(1) << _elapsed) - 1), nslot + 1), _elapsed);
411+
pending = rotl(((WHEEL_C(1) << _elapsed) - 1), oslot + 1);
412412
}
413413

414414
while (pending & T->pending[wheel]) {

0 commit comments

Comments
 (0)