From: Willy Tarreau Date: Wed, 24 Mar 2021 14:34:25 +0000 (+0100) Subject: CLEANUP: fd: slightly simplify up _fd_delete_orphan() X-Git-Tag: v2.4-dev14~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d4232901c59b4065003aca7b436185fe7424480;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/fd.c b/src/fd.c index 6a63ec5560..b3ae2c40b8 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;