QHttpServerHttp2ProtocolHandler: replace a QList with a std::array<4>


There are always exactly four QMetaObject::Connections per stream-ID.

Technicaly speaking, the old code didn't enforce that, because it
grabbed a reference to m_streamConnections[id] and just appended for
connections more. But the handling of m_streamQueue further up in
onStreamCreated() suggests that if stream-IDs were to be duplicated,
we'd have bigger problems (we'd erase the old stream's
QHttpServerHttp2Queue).

So assume that stream-IDs don't come in doppelgangers and enforce this
in the type system by making the mapped_type of m_streamConnections a
std::array<4> instead of a QList. This takes the code one step closer
to being able to work with move-only Connection objects, but even so,
it removes one memory allocation per stream, too. Many a mickle makes
a muckle.

Amends 7dcfe247618e87774591312a25271d796da9794d (6.11) for the last
two, 1e290b29e1cc765bc00f9f8e61895ae1107c0ff2 (picked to 6.8) for the
second, and 80ef46fef8232a8d3d262563efe9afe342b83922 (6.8) for the
first connection.

Pick-to: 6.11 6.10 6.8
Change-Id: I64d8cc5a9fce21aec80c39ce0170552d2d0f8381
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
commitc3bc7f7781ec4101b1f4157424411e382569acbc
parent0f7e9d3329a292f0834dd7ed7bddd95a73993d54
authorMarc Mutz <marc.mutz@qt.io>
committerMarc Mutz <marc.mutz@qt.io>
commit timeThu, 26 Mar 2026 07:54:20 +0000