summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQXSoftware <lh563566994@126.com>2018-10-03 19:13:56 +0800
committerGarrett D'Amore <garrett@damore.org>2018-10-12 10:30:35 -0700
commit64e3343b5925c46b76881d6ccf29622ed5fb5b6a (patch)
tree4156ceb9d41463063a3b5b047d56af4e6e459a50
parentcee9c53a51cdbd7d3f9a8395de37570be5687db8 (diff)
downloadnng-64e3343b5925c46b76881d6ccf29622ed5fb5b6a.tar.gz
nng-64e3343b5925c46b76881d6ccf29622ed5fb5b6a.tar.bz2
nng-64e3343b5925c46b76881d6ccf29622ed5fb5b6a.zip
remove redundant zero memory operations
-rw-r--r--src/core/message.c1
-rw-r--r--src/supplemental/util/platform.c1
2 files changed, 0 insertions, 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);