Bruno Haible <br...@clisp.org> writes:

> Simon Josefsson wrote:
>> I happened to run 'syntax-check' on some gnulib files, and notices this
>> in lib/striconv.c:
>> 
>>       if (result != NULL)
>>         free (result);
>> 
>> Bruno, do you object to removing the unnecessary if?
>
> It is in a part of the code which is rarely executed, therefore the penalty
> of an added function call does not matter. Therefore, no objection.

Fixed, thanks.

> Btw, it's not a typo. When I write
>
>       if (result != NULL)
>         free (result);
>
> it's either
>   - because it makes the logic clearer (you have to think less when you want
>     to verify that the code is correct), or
>   - an attempt to not assume too much from a system function, or
>   - an optimization that avoids an unnecessary function call.

Understood, it was wrong to use the word 'typo' to characterize this.

/Simon


Reply via email to