From: Dmitry Volyntsev Date: Thu, 28 Mar 2019 17:42:11 +0000 (+0300) Subject: Improved njs_object_enumerate(). X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=352739bbec12447a4e3f1715290c23db50519646;p=njs.git Improved njs_object_enumerate(). --- 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);