oid: optimize git_oid_fromstrn by using memset

Signed-off-by: J. David Ibáñez <jdavid.ibp@gmail.com>
This commit is contained in:
J. David Ibáñez 2011-09-30 19:41:29 +02:00
parent e724b058b2
commit 6d8d3f195c

View File

@ -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;
}