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
|
@ -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;
|
||||||
|
@ -152,6 +153,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,
|
||||||
int fd) {
|
int fd) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue