[njs] Style.

Dmitry Volyntsev xeioex at nginx.com
Thu Sep 29 07:36:13 UTC 2022


details:   https://hg.nginx.org/njs/rev/60cf808fe4ff
branches:  
changeset: 1968:60cf808fe4ff
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Thu Sep 29 00:35:34 2022 -0700
description:
Style.

diffstat:

 src/njs_array.c       |  11 ++++++++---
 src/njs_object_prop.c |   9 ++++++---
 2 files changed, 14 insertions(+), 6 deletions(-)

diffs (61 lines):

diff -r 1137ad409fee -r 60cf808fe4ff src/njs_array.c
--- a/src/njs_array.c	Tue Sep 27 16:52:31 2022 -0700
+++ b/src/njs_array.c	Thu Sep 29 00:35:34 2022 -0700
@@ -173,7 +173,8 @@ njs_array_convert_to_slow_array(njs_vm_t
 
 
 njs_int_t
-njs_array_length_redefine(njs_vm_t *vm, njs_value_t *value, uint32_t length, int writable)
+njs_array_length_redefine(njs_vm_t *vm, njs_value_t *value, uint32_t length,
+    int writable)
 {
     njs_object_prop_t  *prop;
 
@@ -1631,14 +1632,18 @@ njs_array_indices_handler(const void *fi
     njs_string_get(val1, &str1);
     njs_string_get(val2, &str2);
 
-    cmp_res =  strncmp((const char *) str1.start, (const char *) str2.start,
-                   njs_min(str1.length, str2.length));
+    cmp_res = strncmp((const char *) str1.start, (const char *) str2.start,
+                      njs_min(str1.length, str2.length));
+
     if (cmp_res == 0) {
         if (str1.length < str2.length) {
             return -1;
+
         } else if (str1.length > str2.length) {
             return 1;
+
         } else {
+
             return 0;
         }
     }
diff -r 1137ad409fee -r 60cf808fe4ff src/njs_object_prop.c
--- a/src/njs_object_prop.c	Tue Sep 27 16:52:31 2022 -0700
+++ b/src/njs_object_prop.c	Thu Sep 29 00:35:34 2022 -0700
@@ -467,9 +467,11 @@ done:
 
                         if (prev->configurable != 1 &&
                             prev->writable != 1 &&
-                            !njs_values_strict_equal(&prev->value, &prop->value))
+                            !njs_values_strict_equal(&prev->value,
+                                                     &prop->value))
                         {
-                            njs_type_error(vm, "Cannot redefine property: \"length\"");
+                            njs_type_error(vm, "Cannot redefine "
+                                           "property: \"length\"");
                             return NJS_ERROR;
                         }
 
@@ -477,7 +479,8 @@ done:
                             prev->writable = prop->writable;
                         }
 
-                        return njs_array_length_set(vm, object, prev, &prop->value);
+                        return njs_array_length_set(vm, object, prev,
+                                                    &prop->value);
                     }
                 }
             }



More information about the nginx-devel mailing list