qt5base-lts/tests/auto/corelib
Marc Mutz 5ff7163796 qputenv: port to QByteArrayView
The vast majority of in-tree users pass simple and short C string
literals as the value. By porting to QByteArrayView, we document that
we'll accept non-NUL-terminated data, and do the NUL-termination
internally, using SSO'ed std::string, saving memory allocations in the
common case of short strings.

I didn't bother to check which direction std::string takes for
nullptrs these days (there was a change accepted in that area for
C++20 or 23), so play it safe and protect against them.

Follow-up to

Task-number: QTBUG-105302
Change-Id: I2369acc62f1d5cbc26135396cfe0602d8c75300c
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-06 14:21:46 +00:00
..
animation Add license headers to cmake files 2022-08-03 17:14:55 +02:00
global qputenv: defend against non-NUL-terminated QByteArray values 2022-08-05 19:42:05 +02:00
io qputenv: port to QByteArrayView 2022-08-06 14:21:46 +00:00
itemmodels Add license headers to cmake files 2022-08-03 17:14:55 +02:00
kernel Add license headers to cmake files 2022-08-03 17:14:55 +02:00
mimetypes Add license headers to cmake files 2022-08-03 17:14:55 +02:00
platform Add license headers to cmake files 2022-08-03 17:14:55 +02:00
plugin Add license headers to cmake files 2022-08-03 17:14:55 +02:00
serialization Add license headers to cmake files 2022-08-03 17:14:55 +02:00
text Add Latin 1 case-insensitive Boyer-Moore searcher 2022-08-04 23:12:39 +02:00
thread Add license headers to cmake files 2022-08-03 17:14:55 +02:00
time qputenv: port to QByteArrayView 2022-08-06 14:21:46 +00:00
tools Add license headers to cmake files 2022-08-03 17:14:55 +02:00
CMakeLists.txt Add license headers to cmake files 2022-08-03 17:14:55 +02:00