Skip to content

Commit aeed09c

Browse files
tryfinallyJohnSully
authored andcommitted
aeCommand objects no need for memset and missing init of some memebers.
1 parent 70b80aa commit aeed09c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/ae.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ int aeCreateRemoteFileEvent(aeEventLoop *eventLoop, int fd, int mask,
234234

235235
int ret = AE_OK;
236236

237-
aeCommand cmd = {};
237+
aeCommand cmd;
238238
cmd.op = AE_ASYNC_OP::CreateFileEvent;
239239
cmd.fd = fd;
240240
cmd.mask = mask;
@@ -294,7 +294,6 @@ int aePostFunction(aeEventLoop *eventLoop, std::function<void()> fn, bool fSynch
294294
}
295295

296296
aeCommand cmd = {};
297-
memset(&cmd, 0, sizeof(aeCommand));
298297
cmd.op = AE_ASYNC_OP::PostCppFunction;
299298
cmd.pfn = new (MALLOC_LOCAL) std::function<void()>(fn);
300299
cmd.pctl = nullptr;
@@ -454,7 +453,7 @@ void aeDeleteFileEventAsync(aeEventLoop *eventLoop, int fd, int mask)
454453
{
455454
if (eventLoop == g_eventLoopThisThread)
456455
return aeDeleteFileEvent(eventLoop, fd, mask);
457-
aeCommand cmd;
456+
aeCommand cmd = {};
458457
cmd.op = AE_ASYNC_OP::DeleteFileEvent;
459458
cmd.fd = fd;
460459
cmd.mask = mask;

0 commit comments

Comments
 (0)