mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
slight optimization for dns_rbt_findnode() when bitstrings are involved:
skip the hashing attempts entirely when not at the root of a level
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: rbt.c,v 1.113 2001/05/31 21:52:22 tale Exp $ */
|
/* $Id: rbt.c,v 1.114 2001/05/31 22:32:46 tale Exp $ */
|
||||||
|
|
||||||
/* Principal Authors: DCL */
|
/* Principal Authors: DCL */
|
||||||
|
|
||||||
@@ -860,7 +860,17 @@ dns_rbt_findnode(dns_rbt_t *rbt, dns_name_t *name, dns_name_t *foundname,
|
|||||||
unsigned int hash;
|
unsigned int hash;
|
||||||
isc_boolean_t has_bitstring = ISC_FALSE;
|
isc_boolean_t has_bitstring = ISC_FALSE;
|
||||||
|
|
||||||
if (rbt->hashtable == NULL)
|
/*
|
||||||
|
* If there is no hash table, hashing can't be done.
|
||||||
|
* Similarly, when current != current_root, that
|
||||||
|
* means a left or right pointer was followed, which
|
||||||
|
* only happens when the algorithm fell through to
|
||||||
|
* the traditional binary search because of a
|
||||||
|
* bitstring label, so that traditional search
|
||||||
|
* should be continued.
|
||||||
|
*/
|
||||||
|
if (rbt->hashtable == NULL ||
|
||||||
|
current != current_root)
|
||||||
goto nohash;
|
goto nohash;
|
||||||
|
|
||||||
nlabels = dns_name_countlabels(search_name);
|
nlabels = dns_name_countlabels(search_name);
|
||||||
|
Reference in New Issue
Block a user