Skip to content

Commit 6e8fc70

Browse files
rscharfegitster
authored andcommitted
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 <[email protected]> Acked-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1d4361b commit 6e8fc70

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

sequencer.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4131,9 +4131,7 @@ static int make_script_with_merges(struct pretty_print_context *pp,
41314131
struct object_id *oid = &parent->item->object.oid;
41324132
if (!oidset_contains(&interesting, oid))
41334133
continue;
4134-
if (!oidset_contains(&child_seen, oid))
4135-
oidset_insert(&child_seen, oid);
4136-
else
4134+
if (oidset_insert(&child_seen, oid))
41374135
label_oid(oid, "branch-point", &state);
41384136
}
41394137

0 commit comments

Comments
 (0)