Re: [RFC PATCH 1/5] builtin/checkout: avoid usage of '!!'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 20 September 2017 09:30 AM, Junio C Hamano wrote:
Kaartic Sivaraam <kaarticsivaraam91196@xxxxxxxxx> writes:

There was a usage for which there's no compelling reason.So, replace
such a usage as with something else that expresses the intent more
clearly.
I actually think this is a good example of the exception-rule.  The
function wants to take true or false in "int", and the caller has a
pointer.  And !!ptr is a shorter and more established way than ptr
!= NULL to turn non-NULL ness into an int boolean, without having to
either repeat or introducing an otherwise unnecessary temporary.

Though !!ptr might might be a shorter way to turn a pointer into an
int boolean I think the documentation says pretty well why we
shouldn't be using it,

        "..  can be extremely confusing to others".

Should I drop this treating is an exception rule (or) should I keep this
back?

Thanks,
Kaartic



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux