pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31808 )
Change subject: select: Optimize osmo_fd_get_by_fd ......................................................................
Patch Set 1:
(1 comment)
File src/core/select.c:
https://gerrit.osmocom.org/c/libosmocore/+/31808/comment/8e55334e_1c54d17e PS1, Line 223: if (fd->fd >= 0)
Here I'd like to have an OSMO_ASSERT(fd->fd >=0) instead, but that made one unit test in osmo-mgw hi […]
BTW, the fact that we assert there would also probably mean we can optimize osmo_fd_is_registered() to be O(k) instead of O(n), because we can guarantee that the pointer in the table won't leak and will be NULL when the fd is unregistered.