From 726d04f13a2217b78e2cbef48ef4c889f15b5b68 Mon Sep 17 00:00:00 2001 From: David Steele Date: Mon, 23 Aug 2021 08:31:50 -0400 Subject: [PATCH] Remove useless if in memContextFree(). If the upper bound of the loop is 0 then nothing will be done, making the if condition extraneous. --- src/common/memContext.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/common/memContext.c b/src/common/memContext.c index ec502cba8..ed40fbb65 100644 --- a/src/common/memContext.c +++ b/src/common/memContext.c @@ -802,10 +802,9 @@ memContextFree(MemContext *this) THROW(AssertError, "cannot free inactive context"); // Free child contexts - if (this->contextChildListSize > 0) - for (unsigned int contextIdx = 0; contextIdx < this->contextChildListSize; contextIdx++) - if (this->contextChildList[contextIdx] && this->contextChildList[contextIdx]->state == memContextStateActive) - memContextFree(this->contextChildList[contextIdx]); + for (unsigned int contextIdx = 0; contextIdx < this->contextChildListSize; contextIdx++) + if (this->contextChildList[contextIdx] && this->contextChildList[contextIdx]->state == memContextStateActive) + memContextFree(this->contextChildList[contextIdx]); // Set state to freeing now that there are no child contexts. Child contexts might need to interact with their parent while // freeing so the parent needs to remain active until they are all gone.