summaryrefslogtreecommitdiff
path: root/blame.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2020-09-16 18:07:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-17 16:31:25 (GMT)
commit312cff520742c933bde070be18c51c27e132cff1 (patch)
treec3ede5bbf6ae9745ef609b0298f09f87e0ca7a49 /blame.c
parent97ffa4fab504a9c5e3b63ff886686c7f6ccd4e70 (diff)
downloadgit-312cff520742c933bde070be18c51c27e132cff1.zip
git-312cff520742c933bde070be18c51c27e132cff1.tar.gz
git-312cff520742c933bde070be18c51c27e132cff1.tar.bz2
bloom: split 'get_bloom_filter()' in two
'get_bloom_filter' takes a flag to control whether it will compute a Bloom filter if the requested one is missing. In the next patch, we'll add yet another parameter to this method, which would force all but one caller to specify an extra 'NULL' parameter at the end. Instead of doing this, split 'get_bloom_filter' into two functions: 'get_bloom_filter' and 'get_or_compute_bloom_filter'. The former only looks up a Bloom filter (and does not compute one if it's missing, thus dropping the 'compute_if_not_present' flag). The latter does compute missing Bloom filters, with an additional parameter to store whether or not it needed to do so. This simplifies many call-sites, since the majority of existing callers to 'get_bloom_filter' do not want missing Bloom filters to be computed (so they can drop the parameter entirely and use the simpler version of the function). While we're at it, instrument the new 'get_or_compute_bloom_filter()' with counters in the 'write_commit_graph_context' struct which store the number of filters that we did and didn't compute, as well as filters that were truncated. It would be nice to drop the 'compute_if_not_present' flag entirely, since all remaining callers of 'get_or_compute_bloom_filter' pass it as '1', but this will change in a future patch and hence cannot be removed. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'blame.c')
-rw-r--r--blame.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/blame.c b/blame.c
index 3e5f878..756285f 100644
--- a/blame.c
+++ b/blame.c
@@ -1275,7 +1275,7 @@ static int maybe_changed_path(struct repository *r,
if (commit_graph_generation(origin->commit) == GENERATION_NUMBER_INFINITY)
return 1;
- filter = get_bloom_filter(r, origin->commit, 0);
+ filter = get_bloom_filter(r, origin->commit);
if (!filter)
return 1;