mirror of https://mirror.osredm.com/root/redis.git
Remove redundant event loop fd processing
Reason: https://github.com/antirez/redis/pull/1450#issuecomment-30432925 Closes #1450
This commit is contained in:
parent
f510cfb4ef
commit
a8d3e930bc
4
src/ae.c
4
src/ae.c
|
@ -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)
|
||||||
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) {
|
||||||
|
|
Loading…
Reference in New Issue