aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_string.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2006-10-16 12:21:17 +0000
committerIgor Sysoev <igor@sysoev.ru>2006-10-16 12:21:17 +0000
commit066496a56c13fde1f087d90d4b67208f57895a04 (patch)
tree3de82426901c92bb71271ed519a42bf622be5dac /src/core/ngx_string.c
parente5efadb60ee795e96a51116cc81451eeb3e397cc (diff)
downloadnginx-066496a56c13fde1f087d90d4b67208f57895a04.tar.gz
nginx-066496a56c13fde1f087d90d4b67208f57895a04.zip
decrease number of branches
Diffstat (limited to 'src/core/ngx_string.c')
-rw-r--r--src/core/ngx_string.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c
index 3716df661..886fe00c6 100644
--- a/src/core/ngx_string.c
+++ b/src/core/ngx_string.c
@@ -593,7 +593,7 @@ ngx_atotm(u_char *line, size_t n)
ngx_int_t
ngx_hextoi(u_char *line, size_t n)
{
- u_char ch;
+ u_char c, ch;
ngx_int_t value;
if (n == 0) {
@@ -608,13 +608,10 @@ ngx_hextoi(u_char *line, size_t n)
continue;
}
- if (ch >= 'A' && ch <= 'F') {
- value = value * 16 + (ch - 'A' + 10);
- continue;
- }
+ c = (u_char) (ch | 0x20);
- if (ch >= 'a' && ch <= 'f') {
- value = value * 16 + (ch - 'a' + 10);
+ if (c >= 'a' && c <= 'f') {
+ value = value * 16 + (c - 'a' + 10);
continue;
}