| 7 | #include "repository.h" |
| 8 | |
| 9 | static 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 | |
| 32 | static inline uint32_t closest_pow2(uint32_t v) |
| 33 | { |
no test coverage detected