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

This commit is contained in:
Max Kellermann 2020-10-12 12:38:46 +02:00
parent 8b94e8f260
commit f73c4643ef
2 changed files with 4 additions and 4 deletions

View File

@ -142,9 +142,9 @@ PollGroupWinSelect::ReadEvents(PollResultGeneric &result,
}
int ret = select(0,
read_set.IsEmpty() ? nullptr : read_set.GetPtr(),
write_set.IsEmpty() ? nullptr : write_set.GetPtr(),
except_set.IsEmpty() ? nullptr : except_set.GetPtr(),
read_set.GetPtr(),
write_set.GetPtr(),
except_set.GetPtr(),
timeout_ms < 0 ? nullptr : &tv);
if (ret == 0 || ret == SOCKET_ERROR)

View File

@ -52,7 +52,7 @@ public:
}
fd_set *GetPtr() noexcept {
return &set;
return IsEmpty() ? nullptr : &set;
}
size_t Size() const noexcept {