From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: "René Scharfe" <l.s.r@web.de>
Cc: Git List <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] sequencer: use return value of oidset_insert()
Date: Wed, 3 Oct 2018 22:14:28 +0200 (DST) [thread overview]
Message-ID: <nycvar.QRO.7.76.6.1810032213330.73@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <18bf2384-694c-f98b-1c31-3c80c07bde2a@web.de>
[-- Attachment #1: Type: text/plain, Size: 999 bytes --]
Hi René,
On Wed, 3 Oct 2018, René Scharfe wrote:
> oidset_insert() returns 1 if the object ID is already in the set and
> doesn't add it again, or 0 if it hadn't been present. Make use of that
> fact instead of checking with an extra oidset_contains() call.
>
> Signed-off-by: Rene Scharfe <l.s.r@web.de>
> ---
ACK!
Thanks,
Dscho
> sequencer.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/sequencer.c b/sequencer.c
> index ddb41a62d9..6387c9ee6e 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -4146,9 +4146,7 @@ static int make_script_with_merges(struct pretty_print_context *pp,
> struct object_id *oid = &parent->item->object.oid;
> if (!oidset_contains(&interesting, oid))
> continue;
> - if (!oidset_contains(&child_seen, oid))
> - oidset_insert(&child_seen, oid);
> - else
> + if (oidset_insert(&child_seen, oid))
> label_oid(oid, "branch-point", &state);
> }
>
> --
> 2.19.0
>
prev parent reply other threads:[~2018-10-03 20:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-03 13:06 [PATCH] sequencer: use return value of oidset_insert() René Scharfe
2018-10-03 20:14 ` Johannes Schindelin [this message]
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=nycvar.QRO.7.76.6.1810032213330.73@tvgsbejvaqbjf.bet \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=l.s.r@web.de \
/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).