[nginx] Refactored ngx_parse_time().
Ruslan Ermilov
ru at nginx.com
Tue Mar 17 09:59:47 UTC 2015
details: http://hg.nginx.org/nginx/rev/040e2736e8dc
branches:
changeset: 6010:040e2736e8dc
user: Ruslan Ermilov <ru at nginx.com>
date: Tue Mar 17 00:26:18 2015 +0300
description:
Refactored ngx_parse_time().
No functional changes.
diffstat:
src/core/ngx_parse.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diffs (28 lines):
diff -r 15a15f6ae3a2 -r 040e2736e8dc src/core/ngx_parse.c
--- a/src/core/ngx_parse.c Tue Mar 17 00:26:15 2015 +0300
+++ b/src/core/ngx_parse.c Tue Mar 17 00:26:18 2015 +0300
@@ -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;
More information about the nginx-devel
mailing list