summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-08-22 15:32:03 +0300
committerAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-09-15 09:08:45 +0000
commit6b2071c697d4c48f0cd289b28b443ebffc3432e6 (patch)
treef947afcd0bc2b2374b5adfd3267e3f11ed4cebc8 /src/plugins
parentbee70b24c1d6180465e9040a0f8bbff051405e0c (diff)
Use QStringBuilder more to optimize memory allocations
Change-Id: I2939ffa10496fdc59e0402a9cb54458565ccd657 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/xcb/qxcbmime.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp3
2 files changed, 2 insertions, 5 deletions
diff --git a/src/plugins/platforms/xcb/qxcbmime.cpp b/src/plugins/platforms/xcb/qxcbmime.cpp
index 4803c14c4c..749906d1e8 100644
--- a/src/plugins/platforms/xcb/qxcbmime.cpp
+++ b/src/plugins/platforms/xcb/qxcbmime.cpp
@@ -121,9 +121,7 @@ bool QXcbMime::mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeDa
// so QXcbConnection::atomName() has to be used.
if (atomName == QLatin1String("text/uri-list")
&& connection->atomName(a) == "text/x-moz-url") {
- const QByteArray uri = data->split('\n').first();
- QString mozUri = QString::fromLatin1(uri, uri.size());
- mozUri += QLatin1Char('\n');
+ const QString mozUri = QLatin1String(data->split('\n').constFirst()) + QLatin1Char('\n');
*data = QByteArray(reinterpret_cast<const char *>(mozUri.utf16()),
mozUri.length() * 2);
} else if (atomName == QLatin1String("application/x-color"))
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index e4c92c5206..a9675935f4 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -61,8 +61,7 @@ QXcbVirtualDesktop::QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t
, m_number(number)
, m_xSettings(Q_NULLPTR)
{
- QByteArray cmAtomName("_NET_WM_CM_S");
- cmAtomName += QByteArray::number(m_number);
+ const QByteArray cmAtomName = "_NET_WM_CM_S" + QByteArray::number(m_number);
m_net_wm_cm_atom = connection->internAtom(cmAtomName.constData());
m_compositingActive = connection->getSelectionOwner(m_net_wm_cm_atom);