[PATCH] Add --foreground option for nscd
Jeff Law
law@redhat.com
Wed May 9 17:24:00 GMT 2012
On 05/09/2012 07:42 AM, Carlos O'Donell wrote:
> On Wed, May 9, 2012 at 9:41 AM, Carlos O'Donell<carlos@systemhalted.org> wrote:
>> Please use an enum. Magic constants are difficult to understand.
>>
>> Everyone understands:
>>
>> if (var == NAMED_STATE)
>>
>> Nobody understands:
>>
>> if (var<= 0)
>>
>> ... until they go and read the comment which describes two states at 1, and -1.
>
> If you argue that the compiler does a better job with<= 0 then please
> hide it behind a macro.
>
> e.g. if (NAMED_STATE(var))
As a GCC developer, I can make an argument for either approach and which
is best would be highly dependent on the context.
What I don't see is how this code is performance critical enough to
worry about this kind of microoptimization.
My suggestion is to write clear simple code first, and only
microoptimize if the code turns out to be performance critical.
Jeff
More information about the Libc-alpha
mailing list