Dear All
thank you for your quick reply
you are right, if the compiler do the job optimization
Thank's for your help
JJacques

On Sat, Mar 4, 2017 at 6:45 PM, Michael Hennebry <
[email protected]> wrote:

> On Sat, 4 Mar 2017, Jean-Jacques LOHEAC wrote:
>
> lines
>> ./glpssx02.c:         if (ssx->q == 0)
>> ./glpssx02.c:         if (ssx->p == 0)
>>
>> becomes
>> ./glpssx02.c:         if (!ssx->q)
>> ./glpssx02.c:         if (!ssx->p)
>>
>> If you look at the low level the processor has already load the value in
>> the register and the status zero is already on or off
>> it is not necessary to compare the value with zero. you optimize the code
>> and the number of cpu cycles @ low level
>>
>
> Do you have some reason to believe that the
> compiler is too dumb to do that on its own?
>
> Changing the source gratuitously would require another
> round of tests to ensure that it was done correctly.
>
> The choice might come down to legibility.
> "if(flag)" is appropriate if flag is used as a bit.
> "if(0==index)" is appropriate if index can have
> multiple values and zero needs special handling.
>
> --
> Michael   [email protected]
> "Sorry but your password must contain an uppercase letter, a number,
> a haiku, a gang sign, a heiroglyph, and the blood of a virgin."
>                                                              --
> someeecards
>
_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to