From: Junio C Hamano <gitster@pobox.com>
To: "Michał Górny" <mgorny@gentoo.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v4] gpg-interface.c: detect and reject multiple signatures on commits
Date: Mon, 22 Oct 2018 09:58:50 +0900 [thread overview]
Message-ID: <xmqqefciztit.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <1540105841.1174.1.camel@gentoo.org> ("Michał Górny"'s message of "Sun, 21 Oct 2018 09:10:41 +0200")
Michał Górny <mgorny@gentoo.org> writes:
>> Very minor point but by not using pre-increment, i.e.
>>
>> if (seen_exclusive_status++)
>> goto found_duplicate_status;
>>
>> you can use the expression as a "have we already seen?" boolean,
>> whic may probably be more idiomatic.
>>
>> The patch is good in the way written as-is, and this is so minor
>> that it is not worth rerolling to only update this part.
>>
>
> Sure, thanks. For the record, I've been taught to use pre-increment
> whenever possible to avoid copying the variable but I suppose it doesn't
> really matter here. Just a habit.
Yes, it's a habit many C++ trained people spread; it just looks
weird to see a pre-increment of a "have we done this once?" variable
and end up comparing to see if it is strictly greater than 1
(i.e. have we reached 2 or more?).
next prev parent reply other threads:[~2018-10-22 1:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-20 19:30 [PATCH v4] gpg-interface.c: detect and reject multiple signatures on commits Michał Górny
2018-10-20 23:57 ` Junio C Hamano
2018-10-21 7:10 ` Michał Górny
2018-10-22 0:58 ` Junio C Hamano [this message]
2018-10-22 8:04 ` Michał Górny
2018-10-22 15:25 ` Michał Górny
2018-11-03 15:17 ` Duy Nguyen
2018-11-03 15:32 ` Michał Górny
2018-11-03 15:36 ` Duy Nguyen
2018-11-03 15:58 ` Michał Górny
2018-11-03 15:42 ` Duy Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqefciztit.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mgorny@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).