The vast majority of header fields appear only once, but there was no efficient way to get that value: values() returns as a QList<QByteArray> (allocating) while combinedValue() returns a QByteArray constructed from values().join() (also allocating). It follows that the QHttpHeaders API is incomplete (lacks an efficient basis of operations in EoP terms). Add a value() function that returns either the value or a user-provided fall-back as a QByteArrayView. Unlike values() and combinedValue(), this function can be noexcept, greatly improving codegen for callers. Found in API review. Task-number: QTBUG-107042 Change-Id: I2da20815fd46fdd7f150c224f41eee53abed313e Reviewed-by: Juha Vuolle <juha.vuolle@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 7897ec88f426773cea38ce8c21091a05718a09e7)
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%