Show 25 quoted lines
> From: Matthieu Moy <Matthieu.Moy@imag.fr>
>
> The common
>
> void function() {
> struct wt_status_state *state = calloc(...);
> ...
> free(state);
> }
>
> is essentially a less efficient, and more error prone way of allocating a
> variable on the stack (plus, the calloc should have been a xcalloc).
> Replace it with an on-stack variable.
>
> While we're there, also replace the individual initializations of fields
> with memset(..., 0, ...).
>
> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
> ---
>
> (BTW, I didn't find a way to have both --autosquash-compliant and
> meaningfull titles)
>
> wt-status.c | 49 +++++++++++++++++++++----------------------------
> 1 file changed, 21 insertions(+), 28 deletions(-)