Avoid redundant string length function calls

Also switch to `std::string_view` as it is more generic and can handle more types (including
view types).

PR #21861.
This commit is contained in:
Chocobo1
2024-11-19 02:53:16 +08:00
committed by GitHub
parent 530631322d
commit 6ddde3f4b6
9 changed files with 112 additions and 108 deletions

View File

@@ -50,7 +50,7 @@ using QStringPair = std::pair<QString, QString>;
namespace
{
const QByteArray EOH = QByteArray(CRLF).repeated(2);
const QByteArray EOH = CRLF.repeated(2);
const QByteArrayView viewWithoutEndingWith(const QByteArrayView in, const QByteArrayView str)
{