Skip to content

Commit fa86a09

Browse files
authored
Merge pull request libgit2#4178 from libgit2/ethomson/enfasten_sha1
sha1dc: perf improvements from upstream
2 parents 6987368 + d672963 commit fa86a09

File tree

5 files changed

+888
-231
lines changed

5 files changed

+888
-231
lines changed

src/hash/hash_collisiondetect.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,8 @@ GIT_INLINE(int) git_hash_init(git_hash_ctx *ctx)
2828

2929
GIT_INLINE(int) git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
3030
{
31-
const char *p = data;
32-
3331
assert(ctx);
34-
35-
/* We expect a size_t, but sha1dc only takes an int */
36-
while (len > INT_MAX) {
37-
SHA1DCUpdate(&ctx->c, p, INT_MAX);
38-
p += INT_MAX;
39-
len -= INT_MAX;
40-
}
41-
42-
SHA1DCUpdate(&ctx->c, p, len);
32+
SHA1DCUpdate(&ctx->c, data, len);
4333
return 0;
4434
}
4535

0 commit comments

Comments
 (0)