summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qbytearraylist.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-02-20 22:55:22 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-24 15:14:04 +0100
commitf12b0f9a38c792abb13f3e6ecff4542986a6f96b (patch)
tree2943d7c88ea0be3ccf29838ce37c0a7ee928cf8a /src/corelib/tools/qbytearraylist.h
parent328a282ebdbbfe185e87e668285d5152a1133bf9 (diff)
QByteArrayList: optimize op+
The old code creates a default-constructed QByteArrayList, then performed two list-appends, the first one of which just performs assignment. Optimize by replacing the default construction and assignment with a copy constructor call. Change-Id: I6d5bd14172798c925b05bd3602e6d1d037d90796 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Diffstat (limited to 'src/corelib/tools/qbytearraylist.h')
-rw-r--r--src/corelib/tools/qbytearraylist.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/corelib/tools/qbytearraylist.h b/src/corelib/tools/qbytearraylist.h
index 5ce6509c28..882bc68f09 100644
--- a/src/corelib/tools/qbytearraylist.h
+++ b/src/corelib/tools/qbytearraylist.h
@@ -97,9 +97,8 @@ inline QByteArray QByteArrayList::join(char sep) const
inline QByteArrayList operator+(const QByteArrayList &lhs, const QByteArrayList &rhs)
{
- QByteArrayList res;
- res.append( lhs );
- res.append( rhs );
+ QByteArrayList res = lhs;
+ res += rhs;
return res;
}