QCoapProtocol: fix Qt-RangeLoopReference Axivion warning


The type of the reply variable is QSharedPointer<QCoapInternalReply>.
The QSharedPointer's copy constructor not only copies the two pointers,
but also increments two ref counters.
It's better to take the value by const-ref when iterating.

Amends 2b3755c8e6587c6a720dd8dcfaafca6e2ba755a9 that introduced the
module.

Fixes: QTBUG-144756
Axivion-Id: qt_Add-ons_qtcoap_dev_linux:SV5
Pick-to: 6.12 6.11 6.8
Change-Id: I573e66b208464b6995c298e4499ffe93dd21930f
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
commit4b712892a10a14dea4bc09c38e6229577347bb0d
parent5ad6b4e145cb74b05a2d51397a4628caf014a287
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeFri, 24 Jul 2026 08:54:37 +0000