mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 23:25:38 +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:
@@ -982,11 +982,11 @@ isc_mem_destroy(isc_mem_t **ctxp) {
|
||||
REQUIRE(VALID_CONTEXT(ctx));
|
||||
|
||||
#if ISC_MEM_TRACKLINES
|
||||
if (isc_refcount_decrement(&ctx->references) != 1) {
|
||||
if (isc_refcount_decrement(&ctx->references) > 1) {
|
||||
print_active(ctx, stderr);
|
||||
}
|
||||
#else
|
||||
INSIST(isc_refcount_decrement(&ctx->references) == 1);
|
||||
isc_refcount_decrement(&ctx->references);
|
||||
#endif
|
||||
isc_refcount_destroy(&ctx->references);
|
||||
destroy(ctx);
|
||||
|
Reference in New Issue
Block a user