From dd798220a05317e439c30d5e79571a19e9913168 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 21 Jan 2022 23:53:15 +0100 Subject: [PATCH] QByteArrayList: micro-optimize join(QByteArray) Null- vs. emptiness of the separator is not significant for join(), so skip the isNull() check in the conversion ctor of QByteArrayView from QByteArray by using the named conversion function that exists for this purpose instead. Pick-to: 6.3 Change-Id: I6ef07cc9bcc0bc8b87ecadc5cfaac9793cfb1b77 Reviewed-by: Thiago Macieira Reviewed-by: Qt CI Bot --- src/corelib/text/qbytearraylist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/text/qbytearraylist.h b/src/corelib/text/qbytearraylist.h index ce613fbe3f8..c4985047fa8 100644 --- a/src/corelib/text/qbytearraylist.h +++ b/src/corelib/text/qbytearraylist.h @@ -86,7 +86,7 @@ public: } Q_WEAK_OVERLOAD inline QByteArray join(const QByteArray &sep) const - { return join(QByteArrayView{sep}); } + { return join(qToByteArrayViewIgnoringNull(sep)); } inline QByteArray join(char sep) const { return join({&sep, 1}); } };