summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2017-03-23 17:25:11 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2017-03-23 17:25:11 +0000
commitd672963535a3e0b4756922169ce6caa0c0116323 (patch)
treea9fd381988bfc55b7f6c7c670f6011bded34f0e5
parentc9efa995e40316e5edb7e64f766d4964bc57901c (diff)
downloadlibgit2-ethomson/enfasten_sha1.tar.gz
sha1dc: `SHA1DCUpdate` now takes a `size_t`ethomson/enfasten_sha1
-rw-r--r--src/hash/hash_collisiondetect.h12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/hash/hash_collisiondetect.h b/src/hash/hash_collisiondetect.h
index 2bb27ba14..5fdae8df6 100644
--- a/src/hash/hash_collisiondetect.h
+++ b/src/hash/hash_collisiondetect.h
@@ -28,18 +28,8 @@ GIT_INLINE(int) git_hash_init(git_hash_ctx *ctx)
GIT_INLINE(int) git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
{
- const char *p = data;
-
assert(ctx);
-
- /* We expect a size_t, but sha1dc only takes an int */
- while (len > INT_MAX) {
- SHA1DCUpdate(&ctx->c, p, INT_MAX);
- p += INT_MAX;
- len -= INT_MAX;
- }
-
- SHA1DCUpdate(&ctx->c, p, len);
+ SHA1DCUpdate(&ctx->c, data, len);
return 0;
}