[njs] Aligning switch statements in njs_typed_array_prototype_iterator().

Dmitry Volyntsev xeioex at nginx.com
Fri Aug 28 11:52:52 UTC 2020


details:   https://hg.nginx.org/njs/rev/b0092a58d4fa
branches:  
changeset: 1511:b0092a58d4fa
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Fri Aug 28 11:48:22 2020 +0000
description:
Aligning switch statements in njs_typed_array_prototype_iterator().

Merging NJS_ARRAY_FILTER case to default case for all switch statements.
This makes code more static-analyzer friendly.

diffstat:

 src/njs_typed_array.c |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (18 lines):

diff -r 0a5145a78a36 -r b0092a58d4fa src/njs_typed_array.c
--- a/src/njs_typed_array.c	Fri Aug 28 11:47:50 2020 +0000
+++ b/src/njs_typed_array.c	Fri Aug 28 11:48:22 2020 +0000
@@ -884,13 +884,11 @@ njs_typed_array_prototype_iterator(njs_v
         break;
 
     case NJS_ARRAY_FILTER:
+    default:
         r = njs_arr_init(vm->mem_pool, &results, NULL, 4, sizeof(njs_value_t));
         if (njs_slow_path(r == NULL)) {
             return NJS_ERROR;
         }
-
-    default:
-        break;
     }
 
     for (i = 0; i < length; i++) {


More information about the nginx-devel mailing list