Skip to content

Commit

Permalink
Remove redundant event loop fd processing
Browse files Browse the repository at this point in the history
Reason:
#1450 (comment)

Closes #1450
  • Loading branch information
liexusong authored and mattsta committed Aug 2, 2014
1 parent 0e90b76 commit 57de6c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ae.c
Expand Up @@ -158,6 +158,9 @@ void aeDeleteFileEvent(aeEventLoop *eventLoop, int fd, int mask)
aeFileEvent *fe = &eventLoop->events[fd];

if (fe->mask == AE_NONE) return;

aeApiDelEvent(eventLoop, fd, mask);

fe->mask = fe->mask & (~mask);
if (fd == eventLoop->maxfd && fe->mask == AE_NONE) {
/* Update the max fd */
Expand All @@ -167,7 +170,6 @@ void aeDeleteFileEvent(aeEventLoop *eventLoop, int fd, int mask)
if (eventLoop->events[j].mask != AE_NONE) break;
eventLoop->maxfd = j;
}
aeApiDelEvent(eventLoop, fd, mask);
}

int aeGetFileEvents(aeEventLoop *eventLoop, int fd) {
Expand Down

0 comments on commit 57de6c3

Please sign in to comment.