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

Function insert_obj_hash

object.c:76–86  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

74 * empty bucket.
75 */
76static 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

Callers 2

grow_object_hashFunction · 0.85
create_objectFunction · 0.85

Calls 1

hash_objFunction · 0.70

Tested by

no test coverage detected