mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2026-06-20 01:17:49 +02:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user