diff options
| author | Maks Naumov <maksqwe1@ukr.net> | 2015-01-15 15:16:19 +0200 |
|---|---|---|
| committer | Maks Naumov <maksqwe1@ukr.net> | 2015-01-15 15:16:19 +0200 |
| commit | d8b5c8c329f93ea84aee558451f82b1d960cb920 (patch) | |
| tree | 9b1e6cba16bfd2d5e1b9c29fd53c32f286f88b36 /src/util.h | |
| parent | 4d6f55acce14eeec55729e55335635375e9026df (diff) | |
| download | libgit2-d8b5c8c329f93ea84aee558451f82b1d960cb920.tar.gz | |
Remove strlen() calls from loop condition
Avoid str length recalculation every iteration
Diffstat (limited to 'src/util.h')
| -rw-r--r-- | src/util.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util.h b/src/util.h index dafb740f8..89816a8c9 100644 --- a/src/util.h +++ b/src/util.h @@ -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; |
