mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-07 23:54:50 +00:00
Remove strlen() calls from loop condition
Avoid str length recalculation every iteration
This commit is contained in:
parent
4d6f55acce
commit
d8b5c8c329
@ -277,7 +277,7 @@ GIT_INLINE(int) git__fromhex(char h)
|
||||
GIT_INLINE(int) git__ishex(const char *str)
|
||||
{
|
||||
unsigned i;
|
||||
for (i=0; i<strlen(str); i++)
|
||||
for (i=0; str[i] != '\0'; i++)
|
||||
if (git__fromhex(str[i]) < 0)
|
||||
return 0;
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user