aboutsummaryrefslogtreecommitdiffstats
path: root/t/helper/test-hash-speed.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-02-10 10:18:30 -0800
committerJunio C Hamano <gitster@pobox.com>2025-02-10 10:18:31 -0800
commit246569bf83f2a586268d26559c7d6ea54c9316b6 (patch)
tree29bdf8fd459a337adef85012b88d6ed71830a147 /t/helper/test-hash-speed.c
parent0ca6b46d7ca17988da3b7292097e5608be81abad (diff)
parent0578f1e66aa381356bfe2f53decf3864d88d23d3 (diff)
downloadgit-246569bf83f2a586268d26559c7d6ea54c9316b6.tar.gz
Merge branch 'ps/hash-cleanup'
Further code clean-up on the use of hash functions. Now the context object knows what hash function it is working with. * ps/hash-cleanup: global: adapt callers to use generic hash context helpers hash: provide generic wrappers to update hash contexts hash: stop typedeffing the hash context hash: convert hashing context to a structure
Diffstat (limited to 't/helper/test-hash-speed.c')
-rw-r--r--t/helper/test-hash-speed.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/t/helper/test-hash-speed.c b/t/helper/test-hash-speed.c
index 80df1aae66..fbf67fe6bd 100644
--- a/t/helper/test-hash-speed.c
+++ b/t/helper/test-hash-speed.c
@@ -3,16 +3,16 @@
#define NUM_SECONDS 3
-static inline void compute_hash(const struct git_hash_algo *algo, git_hash_ctx *ctx, uint8_t *final, const void *p, size_t len)
+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)
{
- git_hash_ctx ctx;
+ struct git_hash_ctx ctx;
unsigned char hash[GIT_MAX_RAWSZ];
clock_t initial, start, end;
unsigned bufsizes[] = { 64, 256, 1024, 8192, 16384 };