[PATCH v2 12/15] commit-graph: drop unnecessary `graph_read_bloom_data_context`
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Aug 30, 2023, 16:43 UTC
- Message-ID
- <4d57f5185400fd44956b596fe8c32cbd1ba185de.1693413637.git.jonathantanmy@google.com>
- In-Reply-To
- <cover.1693413637.git.jonathantanmy@google.com>
From: Taylor Blau <me@ttaylorr.com>
The `graph_read_bloom_data_context` struct was introduced in an earlier commit in order to pass pointers to the commit-graph and changed-path Bloom filter version when reading the BDAT chunk.
The previous commit no longer writes through the changed_paths_version pointer, making the surrounding context structure unnecessary. Drop it and pass a pointer to the commit-graph directly when reading the BDAT chunk.
Noticed-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> --- commit-graph.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/commit-graph.c b/commit-graph.c index 665a3edf78..a8e33c0739 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -304,16 +304,10 @@ static int graph_read_oid_lookup(const unsigned char *chunk_start, return 0; } -struct graph_read_bloom_data_context { - struct commit_graph *g; - int *commit_graph_changed_paths_version; -}; - static int graph_read_bloom_data(const unsigned char *chunk_start, size_t chunk_size, void *data) { - struct graph_read_bloom_data_context *c = data; - struct commit_graph *g = c->g; + struct commit_graph *g = data; uint32_t hash_version; hash_version = get_be32(chunk_start); @@ -405,14 +399,10 @@ struct commit_graph *parse_commit_graph(struct repo_settings *s, } if (s->commit_graph_changed_paths_version) { - struct graph_read_bloom_data_context context = { - .g = graph, - .commit_graph_changed_paths_version = &s->commit_graph_changed_paths_version - }; pair_chunk(cf, GRAPH_CHUNKID_BLOOMINDEXES, &graph->chunk_bloom_indexes); read_chunk(cf, GRAPH_CHUNKID_BLOOMDATA, - graph_read_bloom_data, &context); + graph_read_bloom_data, graph); } if (graph->chunk_bloom_indexes && graph->chunk_bloom_data) {
-- 2.42.0.rc2.253.gd59a3bf2b4-goog