Thread (60 messages) 60 messages, 4 authors, 2021-03-09

Re: [PATCH v2 04/10] diffcore-rename: extend cleanup_dir_rename_info()

flat view

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-02-25 02:27:37

On Thu, Feb 25 2021, Ævar Arnfjörð Bjarmason wrote:
    -		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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help