aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2021-09-27 15:38:55 +0300
committerSergey Kandaurov <pluknet@nginx.com>2021-09-27 15:38:55 +0300
commita5b5b6ca0f36ebba327e35c5d5159458df86b60e (patch)
tree0548b2681ea4acef7c591dac0491573243a22476 /src
parentf2859767d4218e60f8ac3adbac6123c8a1f68279 (diff)
downloadnginx-a5b5b6ca0f36ebba327e35c5d5159458df86b60e.tar.gz
nginx-a5b5b6ca0f36ebba327e35c5d5159458df86b60e.zip
QUIC: moved a variable initialization near to its use.
This tends to produce slightly more optimal code with pos == NULL when built with Clang on low optimization levels. Spotted by Ruslan Ermilov.
Diffstat (limited to 'src')
-rw-r--r--src/event/quic/ngx_event_quic_transport.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/event/quic/ngx_event_quic_transport.c b/src/event/quic/ngx_event_quic_transport.c
index 94d516fc7..85418d1e8 100644
--- a/src/event/quic/ngx_event_quic_transport.c
+++ b/src/event/quic/ngx_event_quic_transport.c
@@ -1967,8 +1967,6 @@ ngx_quic_create_transport_params(u_char *pos, u_char *end, ngx_quic_tp_t *tp,
p = ngx_cpymem(p, value.data, value.len); \
} while (0)
- p = pos;
-
len = ngx_quic_tp_len(NGX_QUIC_TP_INITIAL_MAX_DATA, tp->initial_max_data);
len += ngx_quic_tp_len(NGX_QUIC_TP_INITIAL_MAX_STREAMS_UNI,
@@ -2026,6 +2024,8 @@ ngx_quic_create_transport_params(u_char *pos, u_char *end, ngx_quic_tp_t *tp,
return len;
}
+ p = pos;
+
ngx_quic_tp_vint(NGX_QUIC_TP_INITIAL_MAX_DATA,
tp->initial_max_data);