changeset 6084:54da18a533df stable-1.6

Refactored ngx_parse_time(). No functional changes.
author Ruslan Ermilov <ru@nginx.com>
date Tue, 17 Mar 2015 00:26:18 +0300
parents 516d8e299273
children 8ec0f199cc81
files src/core/ngx_parse.c
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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;