Commit f73c4643 authored by Max Kellermann's avatar Max Kellermann

event/PollGroupWinSelect: move IsEmpty() check to GetPtr()

parent 8b94e8f2
...@@ -142,9 +142,9 @@ PollGroupWinSelect::ReadEvents(PollResultGeneric &result, ...@@ -142,9 +142,9 @@ PollGroupWinSelect::ReadEvents(PollResultGeneric &result,
} }
int ret = select(0, int ret = select(0,
read_set.IsEmpty() ? nullptr : read_set.GetPtr(), read_set.GetPtr(),
write_set.IsEmpty() ? nullptr : write_set.GetPtr(), write_set.GetPtr(),
except_set.IsEmpty() ? nullptr : except_set.GetPtr(), except_set.GetPtr(),
timeout_ms < 0 ? nullptr : &tv); timeout_ms < 0 ? nullptr : &tv);
if (ret == 0 || ret == SOCKET_ERROR) if (ret == 0 || ret == SOCKET_ERROR)
......
...@@ -52,7 +52,7 @@ public: ...@@ -52,7 +52,7 @@ public:
} }
fd_set *GetPtr() noexcept { fd_set *GetPtr() noexcept {
return &set; return IsEmpty() ? nullptr : &set;
} }
size_t Size() const noexcept { size_t Size() const noexcept {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment