[njs] Fixed a dead store.

Dmitry Volyntsev xeioex at nginx.com
Mon Nov 11 12:37:56 UTC 2019


details:   https://hg.nginx.org/njs/rev/b18f8180e6da
branches:  
changeset: 1230:b18f8180e6da
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Mon Nov 11 15:37:39 2019 +0300
description:
Fixed a dead store.

Found by Clang static analyzer.

diffstat:

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

diffs (19 lines):

diff -r 984520294a3c -r b18f8180e6da src/njs_date.c
--- a/src/njs_date.c	Mon Nov 11 15:37:08 2019 +0300
+++ b/src/njs_date.c	Mon Nov 11 15:37:39 2019 +0300
@@ -207,7 +207,6 @@ njs_year_from_days(int64_t *days)
 
         if (d1 < 0) {
             y--;
-            d1 += njs_days_in_year(y);
 
         } else {
             nd = njs_days_in_year(y);
@@ -216,7 +215,6 @@ njs_year_from_days(int64_t *days)
                 break;
             }
 
-            d1 -= nd;
             y++;
         }
     }


More information about the nginx-devel mailing list