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.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.c')
-rw-r--r-- | src/nxt_upstream.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nxt_upstream.c b/src/nxt_upstream.c index 17593173..c92d4a50 100644 --- a/src/nxt_upstream.c +++ b/src/nxt_upstream.c @@ -25,7 +25,7 @@ nxt_upstreams_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf, nxt_upstreams_t *upstreams; nxt_conf_value_t *upstreams_conf, *upcf; - static nxt_str_t upstreams_name = nxt_string("upstreams"); + static const nxt_str_t upstreams_name = nxt_string("upstreams"); upstreams_conf = nxt_conf_get_object_member(conf, &upstreams_name, NULL); |