summaryrefslogtreecommitdiff
path: root/src/oid.c
diff options
context:
space:
mode:
authorMichael Schubert <schu@schu.io>2012-07-27 10:53:09 +0200
committerMichael Schubert <schu@schu.io>2012-07-29 20:50:58 +0200
commitf6b26e770ffae621408532c5b2c1aae4fa1c9e49 (patch)
tree6d8aceb0bb50223d2f4791e11d6cab171923e0ec /src/oid.c
parent6810ba089a543a2407b1c8824dffa9b4e1d63975 (diff)
downloadlibgit2-f6b26e770ffae621408532c5b2c1aae4fa1c9e49.tar.gz
git_oid_cmp: inline memcmp by hand to optimize
git.git uses an inlined hashcmp function instead of memcmp, since it performes much better when comparing hashes (most hashes compared diverge within the first byte). Measurements and rationale for the curious reader: http://thread.gmane.org/gmane.comp.version-control.git/172286
Diffstat (limited to 'src/oid.c')
-rw-r--r--src/oid.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/oid.c b/src/oid.c
index 87756010b..556a2cf85 100644
--- a/src/oid.c
+++ b/src/oid.c
@@ -161,11 +161,6 @@ void git_oid_cpy(git_oid *out, const git_oid *src)
memcpy(out->id, src->id, sizeof(out->id));
}
-int git_oid_cmp(const git_oid *a, const git_oid *b)
-{
- return memcmp(a->id, b->id, sizeof(a->id));
-}
-
int git_oid_ncmp(const git_oid *oid_a, const git_oid *oid_b, unsigned int len)
{
const unsigned char *a = oid_a->id;