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.
This commit is contained in:
Sergey Kandaurov 2021-09-27 15:38:55 +03:00
parent 6e1487496d
commit 7b5283b003

View file

@ -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);