Welcome! Log In Create A New Profile

Advanced

[njs] Inlining call to hash function in njs_property_query().

Dmitry Volyntsev
July 19, 2019 04:30PM
details: https://hg.nginx.org/njs/rev/9da8ebc3dc07
branches:
changeset: 1063:9da8ebc3dc07
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Fri Jul 19 23:27:53 2019 +0300
description:
Inlining call to hash function in njs_property_query().

diffstat:

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

diffs (29 lines):

diff -r 8b977c78885f -r 9da8ebc3dc07 njs/njs_object_property.c
--- a/njs/njs_object_property.c Fri Jul 19 22:05:34 2019 +0300
+++ b/njs/njs_object_property.c Fri Jul 19 23:27:53 2019 +0300
@@ -49,7 +49,6 @@ njs_property_query(njs_vm_t *vm, njs_pro
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_pro
property = &prop;
}

- hash = nxt_djb_hash;
-
switch (object->type) {

case NJS_BOOLEAN:
@@ -140,7 +137,7 @@ njs_property_query(njs_vm_t *vm, njs_pro
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;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Inlining call to hash function in njs_property_query().

Dmitry Volyntsev 257 July 19, 2019 04:30PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 316
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready