summaryrefslogtreecommitdiff
path: root/src/oid.c
diff options
context:
space:
mode:
authorJ. David Ibáñez <jdavid.ibp@gmail.com>2011-09-30 19:41:29 +0200
committerJ. David Ibáñez <jdavid.ibp@gmail.com>2011-09-30 19:41:29 +0200
commit6d8d3f195c9377a1fdb3cbde32ec4a677d93b588 (patch)
tree189acca649d1754f5673515f7392a6fa09ba6caa /src/oid.c
parente724b058b2fd3d3b58291205bb7aeeccc55c21c4 (diff)
downloadlibgit2-6d8d3f195c9377a1fdb3cbde32ec4a677d93b588.tar.gz
oid: optimize git_oid_fromstrn by using memset
Signed-off-by: J. David Ibáñez <jdavid.ibp@gmail.com>
Diffstat (limited to 'src/oid.c')
-rw-r--r--src/oid.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/oid.c b/src/oid.c
index 2adaadcbd..1f7227410 100644
--- a/src/oid.c
+++ b/src/oid.c
@@ -55,8 +55,7 @@ int git_oid_fromstrn(git_oid *out, const char *str, size_t length)
p += 2;
}
- for (; p < GIT_OID_HEXSZ; p += 2)
- out->id[p / 2] = 0x0;
+ memset(out->id + p / 2, 0, (GIT_OID_HEXSZ - p) / 2);
return GIT_SUCCESS;
}