From 650b3269f5ba78953d0750fe1432cbbfef09d155 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Tue, 8 Aug 2017 17:47:53 +0300 Subject: [PATCH] Style fixes. --- njs/njs_generator.c | 5 +---- njs/njs_variable.c | 3 --- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/njs/njs_generator.c b/njs/njs_generator.c index b058b7d6..421f1444 100644 --- a/njs/njs_generator.c +++ b/njs/njs_generator.c @@ -380,7 +380,7 @@ njs_generate_builtin_object(njs_vm_t *vm, njs_parser_t *parser, node->index = njs_generator_dest_index(vm, parser, node); if (nxt_slow_path(node->index == NJS_INDEX_ERROR)) { - return node->index; + return NXT_ERROR; } njs_generate_code(parser, njs_vmcode_object_copy_t, copy); @@ -2541,13 +2541,11 @@ njs_generator_temp_index_get(njs_vm_t *vm, njs_parser_t *parser, } if (vm->accumulative && scope->type == NJS_SCOPE_GLOBAL) { - /* * When non-clonable VM runs in accumulative mode * all global variables are allocated in absolute scope * to simplify global scope handling. */ - value = nxt_mem_cache_align(vm->mem_cache_pool, sizeof(njs_value_t), sizeof(njs_value_t)); if (nxt_slow_path(value == NULL)) { @@ -2557,7 +2555,6 @@ njs_generator_temp_index_get(njs_vm_t *vm, njs_parser_t *parser, index = (njs_index_t) value; } else { - value = nxt_array_add(scope->values[0], &njs_array_mem_proto, vm->mem_cache_pool); if (nxt_slow_path(value == NULL)) { diff --git a/njs/njs_variable.c b/njs/njs_variable.c index 9d2faad6..70bd2623 100644 --- a/njs/njs_variable.c +++ b/njs/njs_variable.c @@ -356,13 +356,11 @@ njs_variable_get(njs_vm_t *vm, njs_parser_node_t *node) } if (vm->accumulative && vs.scope->type == NJS_SCOPE_GLOBAL) { - /* * When non-clonable VM runs in accumulative mode all * global variables should be allocated in absolute scope * to share them among consecutive VM invocations. */ - value = nxt_mem_cache_align(vm->mem_cache_pool, sizeof(njs_value_t), sizeof(njs_value_t)); if (nxt_slow_path(value == NULL)) { @@ -391,7 +389,6 @@ njs_variable_get(njs_vm_t *vm, njs_parser_node_t *node) index = vs.scope->next_index[n]; vs.scope->next_index[n] += sizeof(njs_value_t); - } if (njs_is_object(&var->value)) { -- 2.47.3