Re: [PATCH] simplified the chain if() statements of install_branch_config() function in branch.c

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

 



Nemina Amarasinghe <neminaa@xxxxxxxxx> writes:

>> > ((!remote_is_branch && origin) || (!remote_is_branch || !origin))
>> 
>> Is it?
>> 
>> The above is the same as (!remote_is_branch || !origin).  What you wrote
>> before is the same as (!remote_is_branch).
>> 
>> Maybe you should try copy&paste from the expressions you are trying to
>> combine to make sure that what you start with makes sense.
>> 
> OMG.. Really sorry for that... that was a silly mistake. 
> This is the one..
>
> ((!remote_is_branch && origin) || (!remote_is_branch && !origin))

That is, indeed, perfectly equivalent to (!remote_is_branch).  If you
write

(!remote_is_branch && (origin || !origin))

then you will have people (and possibly also the compiler) loudly
wondering about what you are trying to say here.  The suspicion would be
that either this is a result of a typo or is supposed to be an
annoyingly obtuse replacement for a
/* TODO: treat origin and !origin differently */
kind of comment.

-- 
David Kastrup
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]