mirror of
https://github.com/nginx/nginx.git
synced 2025-06-08 02:02:38 +08:00
Refactored ngx_parse_time().
No functional changes.
This commit is contained in:
parent
8167ce8537
commit
7943fd374a
@ -121,7 +121,6 @@ ngx_parse_time(ngx_str_t *line, ngx_uint_t is_sec)
|
|||||||
value = 0;
|
value = 0;
|
||||||
total = 0;
|
total = 0;
|
||||||
step = is_sec ? st_start : st_month;
|
step = is_sec ? st_start : st_month;
|
||||||
scale = is_sec ? 1 : 1000;
|
|
||||||
|
|
||||||
p = line->data;
|
p = line->data;
|
||||||
last = p + line->len;
|
last = p + line->len;
|
||||||
@ -239,7 +238,6 @@ ngx_parse_time(ngx_str_t *line, ngx_uint_t is_sec)
|
|||||||
}
|
}
|
||||||
|
|
||||||
value = 0;
|
value = 0;
|
||||||
scale = is_sec ? 1 : 1000;
|
|
||||||
|
|
||||||
while (p < last && *p == ' ') {
|
while (p < last && *p == ' ') {
|
||||||
p++;
|
p++;
|
||||||
@ -247,7 +245,7 @@ ngx_parse_time(ngx_str_t *line, ngx_uint_t is_sec)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (valid) {
|
if (valid) {
|
||||||
return total + value * scale;
|
return total + value * (is_sec ? 1 : 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
|
Loading…
Reference in New Issue
Block a user