From 0578f1e66aa381356bfe2f53decf3864d88d23d3 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Fri, 31 Jan 2025 13:55:31 +0100 Subject: global: adapt callers to use generic hash context helpers Adapt callers to use generic hash context helpers instead of using the hash algorithm to update them. This makes the callsites easier to reason about and removes the possibility that the wrong hash algorithm is used to update the hash context's state. And as a nice side effect this also gets rid of a bunch of users of `the_hash_algo`. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- t/helper/test-hash-speed.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't/helper/test-hash-speed.c') diff --git a/t/helper/test-hash-speed.c b/t/helper/test-hash-speed.c index 803f41c89d..fbf67fe6bd 100644 --- a/t/helper/test-hash-speed.c +++ b/t/helper/test-hash-speed.c @@ -6,8 +6,8 @@ static inline void compute_hash(const struct git_hash_algo *algo, struct git_hash_ctx *ctx, uint8_t *final, const void *p, size_t len) { algo->init_fn(ctx); - algo->update_fn(ctx, p, len); - algo->final_fn(final, ctx); + git_hash_update(ctx, p, len); + git_hash_final(final, ctx); } int cmd__hash_speed(int ac, const char **av) -- cgit 1.2.3-korg