]> git.kaiwu.me - njs.git/commitdiff
Inlining call to hash function in njs_property_query().
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 19 Jul 2019 20:27:53 +0000 (23:27 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Fri, 19 Jul 2019 20:27:53 +0000 (23:27 +0300)
njs/njs_object_property.c

index a308699d56e0ed4655bb6df5bee54dfd6606543e..1934c0c5c79fed2bd558d919eb405c248ee25d24 100644 (file)
@@ -49,7 +49,6 @@ njs_property_query(njs_vm_t *vm, njs_property_query_t *pq, njs_value_t *object,
     const njs_value_t *property)
 {
     uint32_t        index;
-    uint32_t        (*hash)(const void *, size_t);
     njs_ret_t       ret;
     njs_object_t    *obj;
     njs_value_t     prop;
@@ -64,8 +63,6 @@ njs_property_query(njs_vm_t *vm, njs_property_query_t *pq, njs_value_t *object,
         property = &prop;
     }
 
-    hash = nxt_djb_hash;
-
     switch (object->type) {
 
     case NJS_BOOLEAN:
@@ -140,7 +137,7 @@ njs_property_query(njs_vm_t *vm, njs_property_query_t *pq, njs_value_t *object,
     if (nxt_fast_path(ret == NXT_OK)) {
 
         njs_string_get(&pq->value, &pq->lhq.key);
-        pq->lhq.key_hash = hash(pq->lhq.key.start, pq->lhq.key.length);
+        pq->lhq.key_hash = nxt_djb_hash(pq->lhq.key.start, pq->lhq.key.length);
 
         if (obj == NULL) {
             pq->own = 1;