[PATCH 3/5] lib: Remove dead code in timerwheel

  • From: Dimitri Staessens <dimitri@ouroboros.rocks>
  • To: ouroboros@xxxxxxxxxxxxx
  • Date: Fri, 25 Feb 2022 00:15:30 +0100

The checked condition can't happen.

Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
---
 src/lib/timerwheel.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/src/lib/timerwheel.c b/src/lib/timerwheel.c
index 487dcd0e..5c0fbfa0 100644
--- a/src/lib/timerwheel.c
+++ b/src/lib/timerwheel.c
@@ -395,12 +395,6 @@ static int timerwheel_ack(int            fd,
 
         clock_gettime(PTHREAD_COND_CLOCK, &now);
 
-        slot = DELT_ACK >> ACKQ_RES;
-        if (slot >= ACKQ_SLOTS) { /* Out of timerwheel range. */
-                free(a);
-                return -EPERM;
-        }
-
         slot = (((ts_to_ns(now) + DELT_ACK) >> ACKQ_RES) + 1)
                 & (ACKQ_SLOTS - 1);
 
-- 
2.35.1


Other related posts:

  • » [PATCH 3/5] lib: Remove dead code in timerwheel - Dimitri Staessens