Commit 880bf17d authored by Max Kellermann's avatar Max Kellermann

event/poll: eliminate one vector::size() call

parent c9da3363
......@@ -31,8 +31,9 @@ PollGroupPoll::~PollGroupPoll() { }
bool PollGroupPoll::Add(int fd, unsigned events, void *obj)
{
assert(items.find(fd) == items.end());
poll_events.resize(poll_events.size() + 1);
size_t index = poll_events.size() - 1;
const size_t index = poll_events.size();
poll_events.resize(index + 1);
auto &e = poll_events[index];
e.fd = fd;
e.events = events;
......
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