fdm: invert check to get rid of one level of indentation

This commit is contained in:
Daniel Eklöf 2019-11-03 00:42:34 +01:00
parent 9f1525aef7
commit 777d851282
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

5
fdm.c
View file

@ -109,7 +109,9 @@ fdm_del_internal(struct fdm *fdm, int fd, bool close_fd)
return true; return true;
tll_foreach(fdm->fds, it) { tll_foreach(fdm->fds, it) {
if (it->item->fd == fd) { if (it->item->fd != fd)
continue;
if (epoll_ctl(fdm->epoll_fd, EPOLL_CTL_DEL, fd, NULL) < 0) if (epoll_ctl(fdm->epoll_fd, EPOLL_CTL_DEL, fd, NULL) < 0)
LOG_ERRNO("failed to unregister FD=%d from epoll", fd); LOG_ERRNO("failed to unregister FD=%d from epoll", fd);
@ -125,7 +127,6 @@ fdm_del_internal(struct fdm *fdm, int fd, bool close_fd)
tll_remove(fdm->fds, it); tll_remove(fdm->fds, it);
return true; return true;
} }
}
LOG_ERR("no such FD: %d", fd); LOG_ERR("no such FD: %d", fd);
return false; return false;