From: Alessio Podda Date: Mon, 9 Mar 2026 23:12:54 +0000 (+0100) Subject: Delete optimistically from rpz nodes hashtable X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48d2e15ed507528dca861f9f2881bd80c5943f0b;p=thirdparty%2Fbind9.git Delete optimistically from rpz nodes hashtable Instead of checking whether an element is present and then deleting it, we can try to delete it optimistically and then rely on the result to know if the element was present or not. --- diff --git a/lib/dns/rpz.c b/lib/dns/rpz.c index 320dcd2589d..81cfb44bcfd 100644 --- a/lib/dns/rpz.c +++ b/lib/dns/rpz.c @@ -1870,10 +1870,8 @@ update_nodes(dns_rpz_zone_t *rpz, isc_ht_t *newnodes) { } /* Does the entry exist in the old nodes table? */ - result = isc_ht_find(rpz->nodes, name->ndata, name->length, - NULL); + result = isc_ht_delete(rpz->nodes, name->ndata, name->length); if (result == ISC_R_SUCCESS) { /* found */ - isc_ht_delete(rpz->nodes, name->ndata, name->length); goto next; }