Re: [PATCH] blame.c: replace instance of !oidcmp for oideq
- From
Jeff King <peff@peff.net>
- Date
- Sep 9, 2020, 09:11 UTC
- Message-ID
- <20200909091149.GB2496536@coredump.intra.peff.net>
- In-Reply-To
- <ce94b41f-e829-d7ca-a5f5-e41748caea81@gmail.com>
On Tue, Sep 08, 2020 at 03:07:34PM -0400, Derrick Stolee wrote:
Show 19 quoted lines
> This message could also mention 14438c4 (introduce hasheq() and
> oideq(), 2018-08-28) which introduced oideq().
>
> This use of !oidcmp() was introduced by 0906ac2b (blame: use
> changed-path Bloom filters, 2020-04-16). My bad. There is no
> good reason to introduce this use since it is well after the
> oideq() method was introduced.
>
> > @@ -1353,8 +1353,8 @@ static struct blame_origin *find_origin(struct repository *r,
> > else {
> > int compute_diff = 1;
> > if (origin->commit->parents &&
> > - !oidcmp(&parent->object.oid,
> > - &origin->commit->parents->item->object.oid))
> > + oideq(&parent->object.oid,
> > + &origin->commit->parents->item->object.oid))
> > compute_diff = maybe_changed_path(r, origin, bd);
>
> The code itself looks correct.Yeah, it looks obviously correct. I am puzzled why "make coccicheck" doesn't find this, though. +cc René, as my favorite target for coccinelle nerd-snipes. :)
(But clearly we should make the change with or without figuring out the coccinelle part).
-Peff