From: Dmitry Volyntsev Date: Fri, 19 Jul 2019 20:27:53 +0000 (+0300) Subject: Inlining call to hash function in njs_property_query(). X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=80fa990bb7bafdf3e9a98354b7037ca1dad9d604;p=njs.git Inlining call to hash function in njs_property_query(). --- diff --git a/njs/njs_object_property.c b/njs/njs_object_property.c index a308699d..1934c0c5 100644 --- a/njs/njs_object_property.c +++ b/njs/njs_object_property.c @@ -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 = ∝ } - 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;