]> git.proxmox.com Git - mirror_frr.git/commit
lib: Allow hash_get to sidestep expensive hash key generation in some cases
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 16 Oct 2017 17:56:01 +0000 (13:56 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 16 Oct 2017 17:56:01 +0000 (13:56 -0400)
commitefb149d95bb4045f44fcaf6e9f1d59f76af6c013
tree93d52158ce587c596a255ca8fac1ad77bec7ce5c
parent4c6ed05e4e2276c463f16c1dbf8d9f04bc1130fe
lib: Allow hash_get to sidestep expensive hash key generation in some cases

There is no need to generate a hash key *if* the hash_alloc_function
is NULL and the hash is empty.

This changed showed a measurable increase in performance for
table hash lookup for tables that were meant to be empty in
bgp( the distance commands ).

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/hash.c