MCPcopy Index your code
hub / github.com/git/git / locate_object_entry_hash

Function locate_object_entry_hash

pack-objects.c:9–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include "repository.h"
8
9static uint32_t locate_object_entry_hash(struct packing_data *pdata,
10 const struct object_id *oid,
11 int *found)
12{
13 uint32_t i, mask = (pdata->index_size - 1);
14
15 i = oidhash(oid) & mask;
16
17 while (pdata->index[i] > 0) {
18 uint32_t pos = pdata->index[i] - 1;
19
20 if (oideq(oid, &pdata->objects[pos].idx.oid)) {
21 *found = 1;
22 return i;
23 }
24
25 i = (i + 1) & mask;
26 }
27
28 *found = 0;
29 return i;
30}
31
32static inline uint32_t closest_pow2(uint32_t v)
33{

Callers 3

rehash_objectsFunction · 0.85
packlist_findFunction · 0.85
packlist_allocFunction · 0.85

Calls 2

oidhashFunction · 0.85
oideqFunction · 0.85

Tested by

no test coverage detected