Re: [PATCH 9/9] show_dirstat: simplify same-content check

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

 



On Sat, Aug 25, 2018 at 4:17 AM Jeff King <peff@xxxxxxxx> wrote:
> We two nested conditionals to store a content_changed

grammo...

> variable, but only bother to look at the result once,
> directly after we set it. We can drop the variable entirely
> and just use a single "if".
>
> This needless complexity is the result of 2ff3a80334 (Teach
> --dirstat not to completely ignore rearranged lines within a
> file, 2011-04-11). Before that, we held onto the
> content_changed variable much longer.
>
> While we're touching the condition, we can swap out oidcmp()
> for !oideq(). Our coccinelle patches didn't previously find
> this case because of the intermediate variable, but now it's
> a simple boolean in a conditional.
>
> Signed-off-by: Jeff King <peff@xxxxxxxx>



[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