sequencer: use return value of oidset_insert()
authorRené Scharfe <l.s.r@web.de>
Wed, 3 Oct 2018 13:06:49 +0000 (15:06 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 4 Oct 2018 04:12:01 +0000 (21:12 -0700)
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>
sequencer.c
index dc2c58d464c14be033f4bcba2ab4332886ead327..3efb8d99450fcd1024345db3c50d32da8df4f7d8 100644 (file)
@@ -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);
                }