aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_parse.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2015-03-17 00:26:18 +0300
committerRuslan Ermilov <ru@nginx.com>2015-03-17 00:26:18 +0300
commit7943fd374aa46806b300242bd68bca1f85acb64c (patch)
tree69ce2403d97b0b222a55e1dd02346b25084ac4c9 /src/core/ngx_parse.c
parent8167ce853792ba9d78af8345c734d0379da22a9c (diff)
downloadnginx-7943fd374aa46806b300242bd68bca1f85acb64c.tar.gz
nginx-7943fd374aa46806b300242bd68bca1f85acb64c.zip
Refactored ngx_parse_time().
No functional changes.
Diffstat (limited to 'src/core/ngx_parse.c')
-rw-r--r--src/core/ngx_parse.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/core/ngx_parse.c b/src/core/ngx_parse.c
index 79f22f05e..aa385bf0e 100644
--- a/src/core/ngx_parse.c
+++ b/src/core/ngx_parse.c
@@ -121,7 +121,6 @@ ngx_parse_time(ngx_str_t *line, ngx_uint_t is_sec)
value = 0;
total = 0;
step = is_sec ? st_start : st_month;
- scale = is_sec ? 1 : 1000;
p = line->data;
last = p + line->len;
@@ -239,7 +238,6 @@ ngx_parse_time(ngx_str_t *line, ngx_uint_t is_sec)
}
value = 0;
- scale = is_sec ? 1 : 1000;
while (p < last && *p == ' ') {
p++;
@@ -247,7 +245,7 @@ ngx_parse_time(ngx_str_t *line, ngx_uint_t is_sec)
}
if (valid) {
- return total + value * scale;
+ return total + value * (is_sec ? 1 : 1000);
}
return NGX_ERROR;