From 352739bbec12447a4e3f1715290c23db50519646 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Thu, 28 Mar 2019 20:42:11 +0300 Subject: [PATCH] Improved njs_object_enumerate(). --- njs/njs_object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/njs/njs_object.c b/njs/njs_object.c index b2f69fbb..8ceb7d93 100644 --- a/njs/njs_object.c +++ b/njs/njs_object.c @@ -1217,10 +1217,11 @@ njs_object_enumerate(njs_vm_t *vm, const njs_value_t *value, if (nxt_fast_path(properties != 0)) { nxt_lvlhsh_each_init(&lhe, &njs_object_hash_proto); + hash = &value->data.u.object->hash; + switch (kind) { case NJS_ENUM_KEYS: - hash = &value->data.u.object->hash; for ( ;; ) { prop = nxt_lvlhsh_each(hash, &lhe); @@ -1251,7 +1252,6 @@ njs_object_enumerate(njs_vm_t *vm, const njs_value_t *value, break; case NJS_ENUM_VALUES: - hash = &value->data.u.object->hash; for ( ;; ) { prop = nxt_lvlhsh_each(hash, &lhe); -- 2.47.3