Commit a8d3e930 authored by Jim Howard's avatar Jim Howard Committed by antirez
Browse files

Remove redundant event loop fd processing

Reason:
https://github.com/antirez/redis/pull/1450#issuecomment-30432925

Closes #1450
parent f510cfb4
...@@ -156,8 +156,9 @@ void aeDeleteFileEvent(aeEventLoop *eventLoop, int fd, int mask) ...@@ -156,8 +156,9 @@ void aeDeleteFileEvent(aeEventLoop *eventLoop, int fd, int mask)
{ {
if (fd >= eventLoop->setsize) return; if (fd >= eventLoop->setsize) return;
aeFileEvent *fe = &eventLoop->events[fd]; aeFileEvent *fe = &eventLoop->events[fd];
if (fe->mask == AE_NONE) return; if (fe->mask == AE_NONE) return;
aeApiDelEvent(eventLoop, fd, mask);
fe->mask = fe->mask & (~mask); fe->mask = fe->mask & (~mask);
if (fd == eventLoop->maxfd && fe->mask == AE_NONE) { if (fd == eventLoop->maxfd && fe->mask == AE_NONE) {
/* Update the max fd */ /* Update the max fd */
...@@ -167,7 +168,6 @@ void aeDeleteFileEvent(aeEventLoop *eventLoop, int fd, int mask) ...@@ -167,7 +168,6 @@ void aeDeleteFileEvent(aeEventLoop *eventLoop, int fd, int mask)
if (eventLoop->events[j].mask != AE_NONE) break; if (eventLoop->events[j].mask != AE_NONE) break;
eventLoop->maxfd = j; eventLoop->maxfd = j;
} }
aeApiDelEvent(eventLoop, fd, mask);
} }
int aeGetFileEvents(aeEventLoop *eventLoop, int fd) { int aeGetFileEvents(aeEventLoop *eventLoop, int fd) {
......
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