From aead219d6d233725466e3a94aa51b393a7b3e331 Mon Sep 17 00:00:00 2001 From: John Barboza Date: Mon, 11 Jun 2018 06:13:41 -0700 Subject: [PATCH] store pointer instead of using array reference all over the place --- deps/uv/src/unix/os390-syscalls.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/deps/uv/src/unix/os390-syscalls.c b/deps/uv/src/unix/os390-syscalls.c index 0f8e11ea2ca4..7974abdc97b0 100644 --- a/deps/uv/src/unix/os390-syscalls.c +++ b/deps/uv/src/unix/os390-syscalls.c @@ -308,18 +308,20 @@ int epoll_wait(uv__os390_epoll* lst, struct epoll_event* events, for (int i = 0; i < lst->size && i < maxevents && reventcount < pollret; ++i) { struct epoll_event ev; + struct pollfd* pfd; - if (pfds[i].fd == -1 || pfds[i].revents == 0) + pfd = &pfds[i]; + if (pfd->fd == -1 || pfd->revents == 0) continue; - ev.fd = pfds[i].fd; - ev.events = pfds[i].revents; - if (pfds[i].revents & POLLIN && pfds[i].revents & POLLOUT) + ev.fd = pfd->fd; + ev.events = pfd->revents; + if (pfd->revents & POLLIN && pfd->revents & POLLOUT) reventcount += 2; - else if (pfds[i].revents & (POLLIN | POLLOUT)) + else if (pfd->revents & (POLLIN | POLLOUT)) ++reventcount; - pfds[i].revents = 0; + pfd->revents = 0; events[nevents++] = ev; }