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 antirez committed Aug 26, 2014
1 parent 5f7866d commit 6ef09f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ae.c
Expand Up @@ -156,8 +156,9 @@ void aeDeleteFileEvent(aeEventLoop *eventLoop, int fd, int mask)
{
if (fd >= eventLoop->setsize) return;
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 +168,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 6ef09f6

Please sign in to comment.