[njs] Code simplification.

Igor Sysoev igor at sysoev.ru
Wed Mar 14 11:34:47 UTC 2018


details:   http://hg.nginx.org/njs/rev/895355fde02c
branches:  
changeset: 458:895355fde02c
user:      Igor Sysoev <igor at sysoev.ru>
date:      Wed Mar 14 14:32:24 2018 +0300
description:
Code simplification.

A dead assignment left after the changeset 6738ff52a2cb was found
by Clang Static Analyzer.

diffstat:

 njs/njs_vm.c |  14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diffs (31 lines):

diff -r 8a274b5f1a04 -r 895355fde02c njs/njs_vm.c
--- a/njs/njs_vm.c	Tue Mar 13 20:37:01 2018 +0300
+++ b/njs/njs_vm.c	Wed Mar 14 14:32:24 2018 +0300
@@ -1179,10 +1179,10 @@ njs_object_property_query(njs_vm_t *vm, 
 
         if (ret == NXT_OK) {
             pq->shared = 1;
-            prop = pq->lhq.value;
-
-            switch (pq->query) {
-            case NJS_PROPERTY_QUERY_GET:
+
+            if (pq->query == NJS_PROPERTY_QUERY_GET) {
+                prop = pq->lhq.value;
+
                 if (prop->type == NJS_NATIVE_GETTER) {
                     pq->scratch = *prop;
                     prop = &pq->scratch;
@@ -1193,12 +1193,6 @@ njs_object_property_query(njs_vm_t *vm, 
                         pq->lhq.value = prop;
                     }
                 }
-
-                break;
-
-            case NJS_PROPERTY_QUERY_IN:
-                prop = pq->lhq.value;
-                break;
             }
 
             return ret;


More information about the nginx-devel mailing list