Make fd_clear() in src/server.c faster
This commit is contained in:
parent
6711f37ab9
commit
5fa29da680
1 changed files with 7 additions and 5 deletions
12
src/server.c
12
src/server.c
|
@ -144,13 +144,15 @@ static inline void fd_clear(patty_ax25_server *server, int fd) {
|
|||
|
||||
FD_CLR(fd, &server->fds_watch);
|
||||
|
||||
for (i=0; i<8*sizeof(&server->fds_watch); i++) {
|
||||
if (FD_ISSET(i, &server->fds_watch)) {
|
||||
server->fd_max = i;
|
||||
if (server->fd_max == fd + 1) {
|
||||
for (i=0; i<8*sizeof(&server->fds_watch); i++) {
|
||||
if (FD_ISSET(i, &server->fds_watch)) {
|
||||
server->fd_max = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
server->fd_max++;
|
||||
server->fd_max++;
|
||||
}
|
||||
}
|
||||
|
||||
static patty_ax25_sock *sock_by_fd(patty_dict *dict,
|
||||
|
|
Loading…
Add table
Reference in a new issue