diff options
author | René Scharfe <l.s.r@web.de> | 2018-10-03 13:06:49 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-10-04 04:12:01 (GMT) |
commit | 6e8fc70fcefd4c362142c7d437488d3fbfdc22a8 (patch) | |
tree | 9fe5224b6776d887deba87834ca9749c58265fdf /sequencer.c | |
parent | 1d4361b0f344188ab5eec6dcea01f61a3a3a1670 (diff) | |
download | git-6e8fc70fcefd4c362142c7d437488d3fbfdc22a8.zip git-6e8fc70fcefd4c362142c7d437488d3fbfdc22a8.tar.gz git-6e8fc70fcefd4c362142c7d437488d3fbfdc22a8.tar.bz2 |
sequencer: use return value of oidset_insert()
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>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r-- | sequencer.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sequencer.c b/sequencer.c index dc2c58d..3efb8d9 100644 --- a/sequencer.c +++ b/sequencer.c @@ -4131,9 +4131,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); } |