Skip to content

Commit 307e307

Browse files
pks-tgitster
authored andcommitted
revision: drop explicit check for commit graph
When filtering down revisions by paths we know to use bloom filters from the commit graph, if we have any. The entry point for this is in `check_maybe_different_in_bloom_filter()`, where we first verify that: - We do have a commit graph. - That the commit is contained therein by checking that we have a proper generation number. - And that the graph contains a bloom filter. The first check is somewhat redundant though: if we don't have a commit graph, then the second check would already tell us that we don't have a generation number for the specific commit. In theory this could be seen as a performance optimization to short-circuit for scenarios where there is no commit graph. But in practice this shouldn't matter: if there is no commit graph, then the commit graph data slab would also be unpopulated and thus a lookup of the commit should happen in constant time. Drop the unnecessary check. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d5a6f50 commit 307e307

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

revision.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,9 +774,6 @@ static int check_maybe_different_in_bloom_filter(struct rev_info *revs,
774774
struct bloom_filter *filter;
775775
int result = 0;
776776

777-
if (!revs->repo->objects->commit_graph)
778-
return -1;
779-
780777
if (commit_graph_generation(commit) == GENERATION_NUMBER_INFINITY)
781778
return -1;
782779

0 commit comments

Comments
 (0)