From: Eric Sunshine Date: Sat, 25 Aug 2018 08:20:33 GMT Subject: Re: [PATCH 9/9] show_dirstat: simplify same-content check Message-ID: In-Reply-To: <20180825081731.GI737@sigill.intra.peff.net> On Sat, Aug 25, 2018 at 4:17 AM Jeff King 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