diff options
author | Andrew Clayton <a.clayton@nginx.com> | 2024-04-16 20:30:48 +0100 |
---|---|---|
committer | Andrew Clayton <a.clayton@nginx.com> | 2024-04-25 15:15:09 +0100 |
commit | 8f861cf4d15e8befca6edcee4b04b5304f082f05 (patch) | |
tree | d1f4bfd3386e6d5a149deb1e164bc2b68b6f3bda /src/nxt_http_route.c | |
parent | e5bc299d7a55a66e1ecf54d35dcdd9448c49f3d4 (diff) | |
download | unit-8f861cf4d15e8befca6edcee4b04b5304f082f05.tar.gz unit-8f861cf4d15e8befca6edcee4b04b5304f082f05.tar.bz2 |
Constify a bunch of static local variables
A common pattern was to declare variables in functions like
static nxt_str_t ...
Not sure why static, as they were being treated more like string
literals (and of course they are _not_ thread safe), let's actually make
them constants (qualifier wise).
This handles core code conversion.
Reviewed-by: Zhidao HONG <z.hong@f5.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'src/nxt_http_route.c')
-rw-r--r-- | src/nxt_http_route.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nxt_http_route.c b/src/nxt_http_route.c index d16d5803..98ff5404 100644 --- a/src/nxt_http_route.c +++ b/src/nxt_http_route.c @@ -405,8 +405,8 @@ nxt_http_route_match_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf, nxt_http_route_addr_rule_t *addr_rule; nxt_http_route_match_conf_t mtcf; - static nxt_str_t match_path = nxt_string("/match"); - static nxt_str_t action_path = nxt_string("/action"); + static const nxt_str_t match_path = nxt_string("/match"); + static const nxt_str_t action_path = nxt_string("/action"); match_conf = nxt_conf_get_path(cv, &match_path); |