Re: [PATCH v2 04/10] diffcore-rename: extend cleanup_dir_rename_info()
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Feb 25, 2021, 02:26 UTC
- Message-ID
- <87sg5k7uhf.fsf@evledraar.gmail.com>
- In-Reply-To
- <87v9ag7uyx.fsf@evledraar.gmail.com>
On Thu, Feb 25 2021, Ævar Arnfjörð Bjarmason wrote:
Show 9 quoted lines
> - partial_clear_dir_rename_count(&renames->dir_rename_count[i]); > - if (!reinitialize) > - strmap_clear(&renames->dir_rename_count[i], 1); > + partial_clear_dir_rename_count(&renames->dir_rename_count[i], > + !reinitialize); > + free(&renames->dir_rename_count[i]); > > strmap_func(&renames->dir_renames[i], 0); > }
That free() wasn't supposed to be in there, I was still experimenting with whether partial_clear_dir_rename_count() should also free() this itself.
But now that I notice I left that in there and in the meantime ran all the tests, they all passed. So maybe this & the if/else in diffcore_rename_extended() can lose its braces by just calling either cleanup_dir_rename_info() or partial_clear_dir_rename_count(). I didn't look in any detail, and if the free() v.s. FREE_AND_NULL() distinction mattered here.