mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Add tests for hash function, and comment dns_rbt_addnode() (#41179)
No CHANGES entry necessary.
This commit is contained in:
@@ -428,10 +428,14 @@ isc_hash_function(const void *data, size_t length,
|
||||
const unsigned char *bp;
|
||||
const unsigned char *be;
|
||||
|
||||
INSIST(data == NULL || length > 0);
|
||||
RUNTIME_CHECK(isc_once_do(&fnv_once, fnv_initialize) == ISC_R_SUCCESS);
|
||||
|
||||
hval = previous_hashp != NULL ? *previous_hashp : fnv_offset_basis;
|
||||
|
||||
if (length == 0)
|
||||
return (hval);
|
||||
|
||||
bp = (const unsigned char *) data;
|
||||
be = bp + length;
|
||||
|
||||
@@ -490,10 +494,14 @@ isc_hash_function_reverse(const void *data, size_t length,
|
||||
const unsigned char *bp;
|
||||
const unsigned char *be;
|
||||
|
||||
INSIST(data == NULL || length > 0);
|
||||
RUNTIME_CHECK(isc_once_do(&fnv_once, fnv_initialize) == ISC_R_SUCCESS);
|
||||
|
||||
hval = ISC_UNLIKELY(previous_hashp != NULL) ? *previous_hashp : fnv_offset_basis;
|
||||
|
||||
if (length == 0)
|
||||
return (hval);
|
||||
|
||||
bp = (const unsigned char *) data;
|
||||
be = bp + length;
|
||||
|
||||
|
Reference in New Issue
Block a user