From 2d4232901c59b4065003aca7b436185fe7424480 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 24 Mar 2021 15:34:25 +0100 Subject: [PATCH] CLEANUP: fd: slightly simplify up _fd_delete_orphan() Let's release the port range earlier so that all zeroes are grouped together and that the compiler can slightly simplify the code. --- src/fd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fd.c b/src/fd.c index 6a63ec556..b3ae2c40b 100644 --- a/src/fd.c +++ b/src/fd.c @@ -309,6 +309,8 @@ void _fd_delete_orphan(int fd) } if (cur_poller.clo) cur_poller.clo(fd); + + port_range_release_port(fdinfo[fd].port_range, fdinfo[fd].local_port); polled_mask[fd].poll_recv = polled_mask[fd].poll_send = 0; fdtab[fd].state = 0; @@ -316,7 +318,6 @@ void _fd_delete_orphan(int fd) #ifdef DEBUG_FD fdtab[fd].event_count = 0; #endif - port_range_release_port(fdinfo[fd].port_range, fdinfo[fd].local_port); fdinfo[fd].port_range = NULL; fdtab[fd].owner = NULL; fdtab[fd].exported = 0;