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_upstream_round_robin.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_upstream_round_robin.c')
-rw-r--r-- | src/nxt_upstream_round_robin.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nxt_upstream_round_robin.c b/src/nxt_upstream_round_robin.c index 31e2f48a..1274f5a9 100644 --- a/src/nxt_upstream_round_robin.c +++ b/src/nxt_upstream_round_robin.c @@ -52,8 +52,8 @@ nxt_upstream_round_robin_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf, nxt_conf_value_t *servers_conf, *srvcf, *wtcf; nxt_upstream_round_robin_t *urr; - static nxt_str_t servers = nxt_string("servers"); - static nxt_str_t weight = nxt_string("weight"); + static const nxt_str_t servers = nxt_string("servers"); + static const nxt_str_t weight = nxt_string("weight"); mp = tmcf->router_conf->mem_pool; |