From b60037201816ecebef83f4dd5023efe82a1dbc62 Mon Sep 17 00:00:00 2001 From: Alberto Bertogli Date: Wed, 6 Oct 2010 13:36:29 -0300 Subject: [PATCH] Remove unused assignments The assignments in this patch were unused or not really needed, so they were removed to improve clarity. They were caught by the clang-analyzer tool. Signed-off-by: Alberto Bertogli --- nmdb/parse.c | 10 ++-------- utils/nmdb-stats.c | 1 - 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/nmdb/parse.c b/nmdb/parse.c index 3456426..fb667fe 100644 --- a/nmdb/parse.c +++ b/nmdb/parse.c @@ -33,14 +33,13 @@ static struct queue_entry *make_queue_long_entry(const struct req_info *req, struct queue_entry *e; unsigned char *kcopy, *vcopy, *nvcopy; - kcopy = vcopy = nvcopy = NULL; - e = queue_entry_create(); if (e == NULL) { return NULL; } - kcopy = NULL; + kcopy = vcopy = nvcopy = NULL; + if (key != NULL) { kcopy = malloc(ksize); if (kcopy == NULL) @@ -48,7 +47,6 @@ static struct queue_entry *make_queue_long_entry(const struct req_info *req, memcpy(kcopy, key, ksize); } - vcopy = NULL; if (val != NULL) { vcopy = malloc(vsize); if (vcopy == NULL) @@ -56,7 +54,6 @@ static struct queue_entry *make_queue_long_entry(const struct req_info *req, memcpy(vcopy, val, vsize); } - nvcopy = NULL; if (newval != NULL) { nvcopy = malloc(nvsize); if (nvcopy == NULL) @@ -548,12 +545,9 @@ static void parse_incr(struct req_info *req) static void parse_firstkey(struct req_info *req) { int rv; - const unsigned char *key; stats.db_firstkey++; - key = req->payload + sizeof(uint32_t); - rv = put_in_queue(req, REQ_FIRSTKEY, 1, NULL, 0, NULL, 0); if (!rv) { req->reply_err(req, ERR_MEM); diff --git a/utils/nmdb-stats.c b/utils/nmdb-stats.c index be5733e..f3cd6f2 100644 --- a/utils/nmdb-stats.c +++ b/utils/nmdb-stats.c @@ -103,7 +103,6 @@ int main(int argc, char **argv) /* The following assumes it can be more than one server. This can * never happen with the current code, but it can be useful as an * example in the future. */ - j = 0; for (i = 0; i < nservers; i++) { printf("stats for server %d:\n", i); -- 2.11.4.GIT