antirez/redis — pull request #1450 by liexusong (2013-12-07 03:27:21+00:00)
Title: 2.8

modified aeDeleteFileEvent() function:
```c
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 */
int j;

for (j = eventLoop->maxfd-1; j >= 0; j--)
if (eventLoop->events[j].mask != AE_NONE) break;
eventLoop->maxfd = j;
}
}
```