diff options
author | Taylor Blau <me@ttaylorr.com> | 2020-09-16 14:07:32 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-17 09:31:25 -0700 |
commit | 312cff520742c933bde070be18c51c27e132cff1 (patch) | |
tree | c3ede5bbf6ae9745ef609b0298f09f87e0ca7a49 /apply.h | |
parent | commit-graph.c: store maximum changed paths (diff) | |
download | tgif-312cff520742c933bde070be18c51c27e132cff1.tar.xz |
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 'apply.h')
0 files changed, 0 insertions, 0 deletions