Add macro for checking if some flags are set
This way we don't need to repeat the argument twice. I didn't replace all instances. I think it's better to leave out: - asserts - comparisons like x & y == x, which are mathematically equivalent, but here we aren't checking if flags are set, but if the argument fits in the flags.
This commit is contained in:
@@ -37,7 +37,7 @@ static int curl_glue_on_io(sd_event_source *s, int fd, uint32_t revents, void *u
|
||||
|
||||
translated_fd = PTR_TO_FD(hashmap_get(g->translate_fds, FD_TO_PTR(fd)));
|
||||
|
||||
if ((revents & (EPOLLIN|EPOLLOUT)) == (EPOLLIN|EPOLLOUT))
|
||||
if (FLAGS_SET(revents, EPOLLIN | EPOLLOUT))
|
||||
action = CURL_POLL_INOUT;
|
||||
else if (revents & EPOLLIN)
|
||||
action = CURL_POLL_IN;
|
||||
|
||||
Reference in New Issue
Block a user