# HG changeset patch # User Ruslan Ermilov # Date 1426541178 -10800 # Node ID 040e2736e8dcffcc2fb487cf2f56d096a59d0753 # Parent 15a15f6ae3a2c4b57329ba8420ddd946c50ab416 Refactored ngx_parse_time(). No functional changes. diff --git a/src/core/ngx_parse.c b/src/core/ngx_parse.c --- 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 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 } 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 } if (valid) { - return total + value * scale; + return total + value * (is_sec ? 1 : 1000); } return NGX_ERROR;