Skip to content

Commit 19677bc

Browse files
committed
pack-bitmap: remove checks before bitmap_free
In pack-bitmap.c:find_boundary_objects, we build a roots_bitmap and cascade it to cb.base. However, I’m wondering why we only free roots_bitmap when the cascade succeeds. It seems we could safely remove this check and always free roots_bitmap afterward, which might provide some performance benefits. Signed-off-by: Lidong Yan <[email protected]>
1 parent 845c48a commit 19677bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pack-bitmap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,8 +1363,8 @@ static struct bitmap *find_boundary_objects(struct bitmap_index *bitmap_git,
13631363
bitmap_set(roots_bitmap, pos);
13641364
}
13651365

1366-
if (!cascade_pseudo_merges_1(bitmap_git, cb.base, roots_bitmap))
1367-
bitmap_free(roots_bitmap);
1366+
cascade_pseudo_merges_1(bitmap_git, cb.base, roots_bitmap);
1367+
bitmap_free(roots_bitmap);
13681368
}
13691369

13701370
/*

0 commit comments

Comments
 (0)