details:   
https://github.com/nginx/njs/commit/a9adadb4f2b3e1ebfe2814feb4f5d943e13d149e
branches:  master
commit:    a9adadb4f2b3e1ebfe2814feb4f5d943e13d149e
user:      Vadim Zhestikov <v.zhesti...@f5.com>
date:      Fri, 6 Jun 2025 16:45:15 -0700
description:
Simplified njs_object_prop_t.

Removed enum_in_object_hash which is only set when prop->type is
NJS_WHITEOUT and this check can be used instead.

---
 src/njs_object.c      | 11 ++---------
 src/njs_object_prop.c |  1 -
 src/njs_value.c       |  1 -
 src/njs_value.h       |  1 -
 4 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/njs_object.c b/src/njs_object.c
index 63273628..dec312c5 100644
--- a/src/njs_object.c
+++ b/src/njs_object.c
@@ -993,13 +993,7 @@ njs_get_own_ordered_keys(njs_vm_t *vm, const njs_object_t 
*object,
 
                 njs_object_prop_t *hash_prop = lhq.value;
 
-                /* select names of prop which are not deleted and
-                 * not deleted and created again i.e.,
-                 * they are replaced shared hash props
-                 */
-                if (hash_prop->type != NJS_WHITEOUT &&
-                    !(hash_prop->enum_in_object_hash))
-                {
+                if (hash_prop->type != NJS_WHITEOUT) {
                     njs_process_prop(vm, &prop_name, flags, items_string,
                                      items_symbol);
                 }
@@ -1060,8 +1054,7 @@ local_hash:
             } else {
                 /* prop is:  in_hash && in_shared_hash */
 
-                /* select names of not deleted and created again */
-                if (prop->enum_in_object_hash) {
+                if (prop->type == NJS_WHITEOUT) {
                     njs_process_prop(vm, &prop_name, flags, items_string,
                                      items_symbol);
                 }
diff --git a/src/njs_object_prop.c b/src/njs_object_prop.c
index d7c55d3a..275cd9ac 100644
--- a/src/njs_object_prop.c
+++ b/src/njs_object_prop.c
@@ -58,7 +58,6 @@ njs_object_prop_alloc2(njs_vm_t *vm,
     }
 
     prop->type = type;
-    prop->enum_in_object_hash = 0;
 
     if (flags != NJS_OBJECT_PROP_UNSET) {
         prop->enumerable = !!(flags & NJS_OBJECT_PROP_ENUMERABLE);
diff --git a/src/njs_value.c b/src/njs_value.c
index fe64afe6..92c87e85 100644
--- a/src/njs_value.c
+++ b/src/njs_value.c
@@ -1452,7 +1452,6 @@ slow_path:
     }
 
     prop->type = NJS_WHITEOUT;
-    prop->enum_in_object_hash = 1;
 
     return NJS_OK;
 }
diff --git a/src/njs_value.h b/src/njs_value.h
index 7bc9eff3..da53f158 100644
--- a/src/njs_value.h
+++ b/src/njs_value.h
@@ -339,7 +339,6 @@ struct njs_object_prop_s {
 #define njs_prop_setter(_p)     (_p)->u.accessor.setter
 
     njs_object_prop_type_t      type:8;          /* 3 bits */
-    njs_object_prop_type_t      enum_in_object_hash:8; /* 3 bits */
 
     njs_object_attribute_t      writable:8;      /* 2 bits */
     njs_object_attribute_t      enumerable:8;    /* 2 bits */
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel

Reply via email to