| 365 | } |
| 366 | |
| 367 | static inline int hasheq(const unsigned char *sha1, const unsigned char *sha2, const struct git_hash_algo *algop) |
| 368 | { |
| 369 | /* |
| 370 | * We write this here instead of deferring to hashcmp so that the |
| 371 | * compiler can properly inline it and avoid calling memcmp. |
| 372 | */ |
| 373 | if (algop->rawsz == GIT_MAX_RAWSZ) |
| 374 | return !memcmp(sha1, sha2, GIT_MAX_RAWSZ); |
| 375 | return !memcmp(sha1, sha2, GIT_SHA1_RAWSZ); |
| 376 | } |
| 377 | |
| 378 | static inline void hashcpy(unsigned char *sha_dst, const unsigned char *sha_src, |
| 379 | const struct git_hash_algo *algop) |
no outgoing calls
no test coverage detected