Re: [PATCH] blame.c: replace instance of !oidcmp for oideq
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 9, 2020, 20:06 UTC
- Message-ID
- <xmqq5z8mvhou.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200909191746.GA2514794@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 19 quoted lines
> @@ > -struct object_id *OIDPTR1; > -struct object_id *OIDPTR2; > +expression OIDPTR1; > +expression OIDPTR2; > @@ > - oidcmp(OIDPTR1, OIDPTR2) == 0 > + oideq(OIDPTR1, OIDPTR2) > @@ -71,8 +71,8 @@ expression E1, E2; > ...>} > > @@ > -struct object_id *OIDPTR1; > -struct object_id *OIDPTR2; > +expression *OIDPTR1; > +expression *OIDPTR2; > @@ > - oidcmp(OIDPTR1, OIDPTR2) != 0 > + !oideq(OIDPTR1, OIDPTR2)
With an extra insight from the counter-example Réne pointed out in your message, I think the above two are safe but all the others are unsafe.