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.
This commit is contained in:
Willy Tarreau 2021-03-24 15:34:25 +01:00
parent 6cf13119e2
commit 2d4232901c

View File

@ -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;