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

Function pack_name_hash

pack-objects.h:204–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202 const struct object_id *oid);
203
204static inline uint32_t pack_name_hash(const char *name)
205{
206 uint32_t c, hash = 0;
207
208 if (!name)
209 return 0;
210
211 /*
212 * This effectively just creates a sortable number from the
213 * last sixteen non-whitespace characters. Last characters
214 * count "most", so things that end in ".c" sort together.
215 */
216 while ((c = *name++) != 0) {
217 if (isspace(c))
218 continue;
219 hash = (hash >> 2) + (c << 24);
220 }
221 return hash;
222}
223
224static inline uint32_t pack_name_hash_v2(const unsigned char *name)
225{

Callers 3

ext_index_add_objectFunction · 0.85
cmd__name_hashFunction · 0.85
pack_name_hash_fnFunction · 0.85

Calls

no outgoing calls

Tested by 1

cmd__name_hashFunction · 0.68