aeCommand objects no need for memset and missing init of some memebers.
Former-commit-id: aeed09c34620e465b57f1d83553d259c4f6d892f
This commit is contained in:
parent
49fecbe1d4
commit
c4cd846388
@ -234,7 +234,7 @@ int aeCreateRemoteFileEvent(aeEventLoop *eventLoop, int fd, int mask,
|
||||
|
||||
int ret = AE_OK;
|
||||
|
||||
aeCommand cmd = {};
|
||||
aeCommand cmd;
|
||||
cmd.op = AE_ASYNC_OP::CreateFileEvent;
|
||||
cmd.fd = fd;
|
||||
cmd.mask = mask;
|
||||
@ -294,7 +294,6 @@ int aePostFunction(aeEventLoop *eventLoop, std::function<void()> fn, bool fSynch
|
||||
}
|
||||
|
||||
aeCommand cmd = {};
|
||||
memset(&cmd, 0, sizeof(aeCommand));
|
||||
cmd.op = AE_ASYNC_OP::PostCppFunction;
|
||||
cmd.pfn = new (MALLOC_LOCAL) std::function<void()>(fn);
|
||||
cmd.pctl = nullptr;
|
||||
@ -454,7 +453,7 @@ void aeDeleteFileEventAsync(aeEventLoop *eventLoop, int fd, int mask)
|
||||
{
|
||||
if (eventLoop == g_eventLoopThisThread)
|
||||
return aeDeleteFileEvent(eventLoop, fd, mask);
|
||||
aeCommand cmd;
|
||||
aeCommand cmd = {};
|
||||
cmd.op = AE_ASYNC_OP::DeleteFileEvent;
|
||||
cmd.fd = fd;
|
||||
cmd.mask = mask;
|
||||
|
Loading…
x
Reference in New Issue
Block a user