| 202 | const struct object_id *oid); |
| 203 | |
| 204 | static 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 | |
| 224 | static inline uint32_t pack_name_hash_v2(const unsigned char *name) |
| 225 | { |
no outgoing calls