[njs] Removed dead code in njs_set_timer().

Dmitry Volyntsev xeioex at nginx.com
Sat Dec 29 12:17:12 UTC 2018


details:   https://hg.nginx.org/njs/rev/157bbb5d50eb
branches:  
changeset: 710:157bbb5d50eb
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Sat Dec 29 15:16:59 2018 +0300
description:
Removed dead code in njs_set_timer().

Found by Coverity (CID 1442096).

diffstat:

 njs/njs_time.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 9fc5ed136eb6 -r 157bbb5d50eb njs/njs_time.c
--- a/njs/njs_time.c	Sat Dec 29 01:43:44 2018 +0800
+++ b/njs/njs_time.c	Sat Dec 29 15:16:59 2018 +0300
@@ -48,7 +48,7 @@ njs_set_timer(njs_vm_t *vm, njs_value_t 
 
     n = immediate ? 2 : 3;
 
-    event->destructor = (ops != NULL) ? ops->clear_timer : NULL;
+    event->destructor = ops->clear_timer;
     event->function = args[1].data.u.function;
     event->nargs = (nargs >= n) ? nargs - n : 0;
     event->once = 1;


More information about the nginx-devel mailing list