diff options
| author | Junio C Hamano <gitster@pobox.com> | 2014-07-21 11:18:44 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2014-07-21 11:18:44 -0700 |
| commit | 9b1c2a3a8e625ea7f56e9ba3d3c0e31938faa738 (patch) | |
| tree | aa21c9fad684c6f6e16d4a1c69a6c6bd70dd54c3 /pack-objects.c | |
| parent | 0ac744305f5885207bf96fc5488fcc59782ffa96 (diff) | |
| parent | 7b64d42d22206d9995a8f0cb3b515e623cac4702 (diff) | |
| download | git-9b1c2a3a8e625ea7f56e9ba3d3c0e31938faa738.tar.xz | |
Merge branch 'kb/hashmap-updates'
* kb/hashmap-updates:
hashmap: add string interning API
hashmap: add simplified hashmap_get_from_hash() API
hashmap: improve struct hashmap member documentation
hashmap: factor out getting a hash code from a SHA1
Diffstat (limited to 'pack-objects.c')
| -rw-r--r-- | pack-objects.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/pack-objects.c b/pack-objects.c index 4f36c32045..9992f3ecf2 100644 --- a/pack-objects.c +++ b/pack-objects.c @@ -7,10 +7,9 @@ static uint32_t locate_object_entry_hash(struct packing_data *pdata, const unsigned char *sha1, int *found) { - uint32_t i, hash, mask = (pdata->index_size - 1); + uint32_t i, mask = (pdata->index_size - 1); - memcpy(&hash, sha1, sizeof(uint32_t)); - i = hash & mask; + i = sha1hash(sha1) & mask; while (pdata->index[i] > 0) { uint32_t pos = pdata->index[i] - 1; |
