mirror of
https://git.proxmox.com/git/libgit2
synced 2025-07-12 15:24:46 +00:00
Merge pull request #2821 from maksqwe/strlen_optimization
Remove strlen() calls from loop condition
This commit is contained in:
commit
d5712ed2b3
@ -277,7 +277,7 @@ GIT_INLINE(int) git__fromhex(char h)
|
|||||||
GIT_INLINE(int) git__ishex(const char *str)
|
GIT_INLINE(int) git__ishex(const char *str)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
for (i=0; i<strlen(str); i++)
|
for (i=0; str[i] != '\0'; i++)
|
||||||
if (git__fromhex(str[i]) < 0)
|
if (git__fromhex(str[i]) < 0)
|
||||||
return 0;
|
return 0;
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user