From: René Scharfe Date: Wed, 3 Oct 2018 13:06:49 +0000 (+0200) Subject: sequencer: use return value of oidset_insert() X-Git-Tag: v2.19.2~18^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/6e8fc70fcefd4c362142c7d437488d3fbfdc22a8?ds=inline;hp=--cc 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 Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- 6e8fc70fcefd4c362142c7d437488d3fbfdc22a8 diff --git a/sequencer.c b/sequencer.c index dc2c58d464..3efb8d9945 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); }