From: Ruslan Ermilov Date: Mon, 16 Mar 2015 21:26:18 +0000 (+0300) Subject: Refactored ngx_parse_time(). X-Git-Tag: release-1.6.3~8 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=ea13aadd303ed8afa404e1aff0b2f33aad79c1a8;p=nginx.git Refactored ngx_parse_time(). No functional changes. --- 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;