* Insert obj into the hash table hash, which has length size (which * must be a power of 2). On collisions, simply overflow to the next * empty bucket. */
| 74 | * empty bucket. |
| 75 | */ |
| 76 | static void insert_obj_hash(struct object *obj, struct object **hash, unsigned int size) |
| 77 | { |
| 78 | unsigned int j = hash_obj(&obj->oid, size); |
| 79 | |
| 80 | while (hash[j]) { |
| 81 | j++; |
| 82 | if (j >= size) |
| 83 | j = 0; |
| 84 | } |
| 85 | hash[j] = obj; |
| 86 | } |
| 87 | |
| 88 | /* |
| 89 | * Look up the record for the given sha1 in the hash map stored in |
no test coverage detected