summaryrefslogtreecommitdiff
path: root/hashmap.h
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhost@microsoft.com>2017-03-22 17:14:21 +0000
committerJunio C Hamano <gitster@pobox.com>2017-03-22 13:41:41 -0700
commitf75619bd6d21760e1da416d4e27bce6468beffcd (patch)
treee46b96b17fbbcf688dfd4945a87fbeaf29160778 /hashmap.h
parent16f9b4cdd31de2b8185c5c717efa6d28c56b3c74 (diff)
downloadgit-f75619bd6d21760e1da416d4e27bce6468beffcd.tar.gz
hashmap: allow memihash computation to be continued
Add variant of memihash() to allow the hash computation to be continued. There are times when we compute the hash on a full path and then the hash on just the path to the parent directory. This can be expensive on large repositories. With this, we can hash the parent directory first. And then continue the computation to include the "/filename". Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'hashmap.h')
-rw-r--r--hashmap.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/hashmap.h b/hashmap.h
index ab7958ae33..45eda693bd 100644
--- a/hashmap.h
+++ b/hashmap.h
@@ -12,6 +12,7 @@ extern unsigned int strhash(const char *buf);
extern unsigned int strihash(const char *buf);
extern unsigned int memhash(const void *buf, size_t len);
extern unsigned int memihash(const void *buf, size_t len);
+extern unsigned int memihash_cont(unsigned int hash_seed, const void *buf, size_t len);
static inline unsigned int sha1hash(const unsigned char *sha1)
{