Skip to content

Commit

Permalink
exclude max_fd_plus_1 calculation for better performance on WIN32
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Sep 5, 2023
1 parent 345d922 commit 332435d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,10 @@ static int fd_poll(struct re *re)
if (fhs->flags & FD_EXCEPT)
FD_SET(fd, &efds);

max_fd_plus_1 = max(max_fd_plus_1, (int)(fd + 1));
/* not needed on WIN32 since select nfds arg is ignored */
#if !defined(WIN32)
max_fd_plus_1 = max(max_fd_plus_1, fd + 1);
#endif
}

nfds = re->maxfds;
Expand Down

0 comments on commit 332435d

Please sign in to comment.