[njs] Fixed fast paths.

Dmitry Volyntsev xeioex at nginx.com
Wed Feb 20 14:26:02 UTC 2019


details:   https://hg.nginx.org/njs/rev/82794813ce4c
branches:  
changeset: 788:82794813ce4c
user:      hongzhidao <hongzhidao at gmail.com>
date:      Sat Feb 16 23:18:43 2019 +0800
description:
Fixed fast paths.

diffstat:

 njs/njs_variable.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 5db48d70db65 -r 82794813ce4c njs/njs_variable.c
--- a/njs/njs_variable.c	Sat Feb 16 23:18:43 2019 +0800
+++ b/njs/njs_variable.c	Sat Feb 16 23:18:43 2019 +0800
@@ -144,7 +144,7 @@ njs_variable_reference(njs_vm_t *vm, njs
 
         ret = nxt_lvlhsh_insert(&scope->references, &lhq);
 
-        if (nxt_slow_path(ret != NXT_ERROR)) {
+        if (nxt_fast_path(ret != NXT_ERROR)) {
             ret = NXT_OK;
         }
     }
@@ -493,7 +493,7 @@ njs_name_copy(njs_vm_t *vm, nxt_str_t *d
 
     dst->start = nxt_mp_alloc(vm->mem_pool, src->length);
 
-    if (nxt_slow_path(dst->start != NULL)) {
+    if (nxt_fast_path(dst->start != NULL)) {
         (void) memcpy(dst->start, src->start, src->length);
 
         return NXT_OK;


More information about the nginx-devel mailing list