]> PatchyGit - patchyircd.git/commitdiff
netpoll: small tweak to binary search func
authorEgor <egor@patchysicp.xyz>
Sun, 22 Oct 2023 13:03:39 +0000 (16:03 +0300)
committerEgor <egor@patchysicp.xyz>
Sun, 22 Oct 2023 13:03:39 +0000 (16:03 +0300)
src/netpoll.c

index 37f93b5..86bef42 100644 (file)
@@ -215,7 +215,7 @@ int net_poll_get(struct net_pollfd *out)
 static int search(SOCKET fd) {
        int l = 0, r = nfds;
        while (l != r) {
-               int m = l + (r-l)/2;
+               int m = (l+r)/2;
                if (REF(fds[m]).fd < fd)
                        l = m+1;
                else if (fd < REF(fds[m]).fd)