From 64e3343b5925c46b76881d6ccf29622ed5fb5b6a Mon Sep 17 00:00:00 2001 From: QXSoftware Date: Wed, 3 Oct 2018 19:13:56 +0800 Subject: remove redundant zero memory operations --- src/core/message.c | 1 - src/supplemental/util/platform.c | 1 - 2 files changed, 2 deletions(-) diff --git a/src/core/message.c b/src/core/message.c index db302c03..41f42234 100644 --- a/src/core/message.c +++ b/src/core/message.c @@ -445,7 +445,6 @@ nni_msg_dup(nni_msg **dup, const nni_msg *src) if ((m = NNI_ALLOC_STRUCT(m)) == NULL) { return (NNG_ENOMEM); } - memset(m, 0, sizeof(*m)); NNI_LIST_INIT(&m->m_options, nni_msgopt, mo_node); if ((rv = nni_chunk_dup(&m->m_header, &src->m_header)) != 0) { diff --git a/src/supplemental/util/platform.c b/src/supplemental/util/platform.c index fc0f839e..691ce867 100644 --- a/src/supplemental/util/platform.c +++ b/src/supplemental/util/platform.c @@ -44,7 +44,6 @@ nng_thread_create(nng_thread **thrp, void (*func)(void *), void *arg) if ((thr = NNI_ALLOC_STRUCT(thr)) == NULL) { return (NNG_ENOMEM); } - memset(thr, 0, sizeof(*thr)); *thrp = (void *) thr; if ((rv = nni_thr_init(thr, func, arg)) != 0) { return (rv); -- cgit v1.2.3-70-g09d2