From d60b4329437936f4c90fe1c112ef27be6b86ddf7 Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Sat, 1 Feb 2025 15:28:40 +0000 Subject: [PATCH] avoid a needless check for set membership in got_pack_repaint_parent_commits() The list of ids traversed here won't contain IDs already present in the set. --- lib/pack_create.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/pack_create.c b/lib/pack_create.c index 36d955d1..9344a08b 100644 --- a/lib/pack_create.c +++ b/lib/pack_create.c @@ -1092,11 +1092,9 @@ got_pack_repaint_parent_commits(struct got_object_id *commit_id, int color, break; STAILQ_REMOVE_HEAD(&ids, entry); - if (!got_object_idset_contains(set, &qid->id)) { - err = got_object_idset_add(set, &qid->id, NULL); - if (err) - break; - } + err = got_object_idset_add(set, &qid->id, NULL); + if (err) + break; err = got_object_open_as_commit(&commit, repo, &qid->id); if (err) -- 2.11.4.GIT