Make fd_clear() in src/server.c faster

This commit is contained in:
XANTRONIX Development 2020-07-21 17:44:18 -04:00 committed by XANTRONIX Industrial
parent 6711f37ab9
commit 5fa29da680

View file

@ -144,6 +144,7 @@ static inline void fd_clear(patty_ax25_server *server, int fd) {
FD_CLR(fd, &server->fds_watch); FD_CLR(fd, &server->fds_watch);
if (server->fd_max == fd + 1) {
for (i=0; i<8*sizeof(&server->fds_watch); i++) { for (i=0; i<8*sizeof(&server->fds_watch); i++) {
if (FD_ISSET(i, &server->fds_watch)) { if (FD_ISSET(i, &server->fds_watch)) {
server->fd_max = i; server->fd_max = i;
@ -151,6 +152,7 @@ static inline void fd_clear(patty_ax25_server *server, int fd) {
} }
server->fd_max++; server->fd_max++;
}
} }
static patty_ax25_sock *sock_by_fd(patty_dict *dict, static patty_ax25_sock *sock_by_fd(patty_dict *dict,