Commit 6d8d3f19 by J. David Ibáñez

oid: optimize git_oid_fromstrn by using memset

Signed-off-by: J. David Ibáñez <jdavid.ibp@gmail.com>
parent e724b058
...@@ -55,8 +55,7 @@ int git_oid_fromstrn(git_oid *out, const char *str, size_t length) ...@@ -55,8 +55,7 @@ int git_oid_fromstrn(git_oid *out, const char *str, size_t length)
p += 2; p += 2;
} }
for (; p < GIT_OID_HEXSZ; p += 2) memset(out->id + p / 2, 0, (GIT_OID_HEXSZ - p) / 2);
out->id[p / 2] = 0x0;
return GIT_SUCCESS; return GIT_SUCCESS;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment