Remove useless if in memContextFree().

If the upper bound of the loop is 0 then nothing will be done, making the if condition extraneous.
This commit is contained in:
David Steele
2021-08-23 08:31:50 -04:00
parent d72d4415a7
commit 726d04f13a
+3 -4
View File
@@ -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.