mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 15:05:23 +00:00
Remove duplicate INSIST checks for isc_refcount API
This commits removes superfluous checks when using the isc_refcount API. Examples of superfluous checks: 1. The isc_refcount_decrement function ensures there was not underflow, so this check is superfluous: INSIST(isc_refcount_decrement(&r) > 0); 2 .The isc_refcount_destroy() includes check whether the counter is zero, therefore this is superfluous: INSIST(isc_refcount_decrement(&r) == 1 && isc_refcount_destroy(&r));
This commit is contained in:
@@ -1484,9 +1484,9 @@ cleanup_task:
|
||||
dns_rbt_destroy(&zones->rbt);
|
||||
|
||||
cleanup_rbt:
|
||||
INSIST(isc_refcount_decrement(&zones->irefs) == 1);
|
||||
isc_refcount_decrement(&zones->irefs);
|
||||
isc_refcount_destroy(&zones->irefs);
|
||||
INSIST(isc_refcount_decrement(&zones->refs) == 1);
|
||||
isc_refcount_decrement(&zones->refs);
|
||||
isc_refcount_destroy(&zones->refs);
|
||||
|
||||
isc_mutex_destroy(&zones->maint_lock);
|
||||
@@ -1567,7 +1567,7 @@ cleanup_ht:
|
||||
isc_timer_detach(&zone->updatetimer);
|
||||
|
||||
cleanup_timer:
|
||||
INSIST(isc_refcount_decrement(&zone->refs) > 0);
|
||||
isc_refcount_decrement(&zone->refs);
|
||||
isc_refcount_destroy(&zone->refs);
|
||||
|
||||
isc_mem_put(rpzs->mctx, zone, sizeof(*zone));
|
||||
|
Reference in New Issue
Block a user