diff options
| author | Vicent Marti <tanoku@gmail.com> | 2013-11-20 12:54:24 +0100 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2013-11-20 12:54:24 +0100 |
| commit | 4b0a36e881506a02b43a4ae3c19c93c919b36eeb (patch) | |
| tree | 026182fa30273a4c1649928b6db3fc5335bd1ea4 /src/oid.h | |
| parent | 29d7242b1dcd1f09a63417abd648a6217b85d301 (diff) | |
| parent | 43cb8b32428b1b29994874349ec22eb5372e152c (diff) | |
| download | libgit2-4b0a36e881506a02b43a4ae3c19c93c919b36eeb.tar.gz | |
Merge branch 'development'
Diffstat (limited to 'src/oid.h')
| -rw-r--r-- | src/oid.h | 23 |
1 files changed, 13 insertions, 10 deletions
@@ -9,17 +9,8 @@ #include "git2/oid.h" -/* - * Compare two oid structures. - * - * @param a first oid structure. - * @param b second oid structure. - * @return <0, 0, >0 if a < b, a == b, a > b. - */ -GIT_INLINE(int) git_oid__cmp(const git_oid *a, const git_oid *b) +GIT_INLINE(int) git_oid__hashcmp(const unsigned char *sha1, const unsigned char *sha2) { - const unsigned char *sha1 = a->id; - const unsigned char *sha2 = b->id; int i; for (i = 0; i < GIT_OID_RAWSZ; i++, sha1++, sha2++) { @@ -30,4 +21,16 @@ GIT_INLINE(int) git_oid__cmp(const git_oid *a, const git_oid *b) return 0; } +/* + * Compare two oid structures. + * + * @param a first oid structure. + * @param b second oid structure. + * @return <0, 0, >0 if a < b, a == b, a > b. + */ +GIT_INLINE(int) git_oid__cmp(const git_oid *a, const git_oid *b) +{ + return git_oid__hashcmp(a->id, b->id); +} + #endif |
