[njs] Removed dead store assignments.

Dmitry Volyntsev xeioex at nginx.com
Thu Jan 9 12:55:28 UTC 2020


details:   https://hg.nginx.org/njs/rev/16e786db8720
branches:  
changeset: 1297:16e786db8720
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Thu Jan 09 15:55:05 2020 +0300
description:
Removed dead store assignments.

Found by Clang static analyzer.

diffstat:

 src/njs_chb.c    |  1 -
 src/njs_number.c |  2 +-
 2 files changed, 1 insertions(+), 2 deletions(-)

diffs (23 lines):

diff -r aa9a42bfc727 -r 16e786db8720 src/njs_chb.c
--- a/src/njs_chb.c	Thu Jan 09 15:54:52 2020 +0300
+++ b/src/njs_chb.c	Thu Jan 09 15:55:05 2020 +0300
@@ -203,7 +203,6 @@ njs_chb_join(njs_chb_t *chain, njs_str_t
         return NJS_ERROR;
     }
 
-    n = chain->nodes;
     str->length = size;
     str->start = start;
 
diff -r aa9a42bfc727 -r 16e786db8720 src/njs_number.c
--- a/src/njs_number.c	Thu Jan 09 15:54:52 2020 +0300
+++ b/src/njs_number.c	Thu Jan 09 15:55:05 2020 +0300
@@ -695,7 +695,7 @@ njs_number_prototype_to_fixed(njs_vm_t *
     if (frac > 0) {
         *p++ = '.';
 
-        p = njs_cpymem(p, &buf2[point], frac);
+        memcpy(p, &buf2[point], frac);
     }
 
     return NJS_OK;


More information about the nginx-devel mailing list