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>
René Scharfe committed
Oct 3, 2018 at 15:06 UTC
6e8fc70fcefd4c362142c7d437488d3fbfdc22a8
1 file changed
+1
-3
sequencer.c
+1
-3
@@ -4131,9 +4131,7 @@ static int make_script_with_merges(struct pretty_print_context *pp,
4131
struct object_id *oid = &parent->item->object.oid;
4132
if (!oidset_contains(&interesting, oid))
4133
continue;
4134
- if (!oidset_contains(&child_seen, oid))
4135
- oidset_insert(&child_seen, oid);
4136
- else
4134
+ if (oidset_insert(&child_seen, oid))
4135
label_oid(oid, "branch-point", &state);
4136
}
4137