diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2013-10-05 22:42:52 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-26 22:03:21 +0100 |
commit | e3db3c4d78e6a82adfb13746d5177abc5d4c12d8 (patch) | |
tree | 7fe96d247043983edf5fbac4cc7add76d5d9f409 /src/plugins/platforms/xcb/qxcbdrag.cpp | |
parent | 922815a2a79e5f093cdf021b7d302bae91f3c22d (diff) |
xcb: replace inefficient uses of QList with QVector
xcb atoms are uint32s, so a QList of them wastes 50% memory on 64-bit
platforms. Other parts of the code already store xcb_atom_t's in QVector,
so use QVector everywhere (also leads to less code expansion).
Change-Id: Ib4afb35e499577a7509d04a18b830d9b31f6abd0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbdrag.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbdrag.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp index 61dfe8ac17..6042ec0f87 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.cpp +++ b/src/plugins/platforms/xcb/qxcbdrag.cpp @@ -183,7 +183,7 @@ void QXcbDrag::startDrag() QStringList fmts = QXcbMime::formatsHelper(drag()->mimeData()); for (int i = 0; i < fmts.size(); ++i) { - QList<xcb_atom_t> atoms = QXcbMime::mimeAtomsForFormat(connection(), fmts.at(i)); + QVector<xcb_atom_t> atoms = QXcbMime::mimeAtomsForFormat(connection(), fmts.at(i)); for (int j = 0; j < atoms.size(); ++j) { if (!drag_types.contains(atoms.at(j))) drag_types.append(atoms.at(j)); @@ -1211,7 +1211,7 @@ QVariant QXcbDropData::xdndObtainData(const QByteArray &format, QVariant::Type r return result; } - QList<xcb_atom_t> atoms = drag->xdnd_types; + QVector<xcb_atom_t> atoms = drag->xdnd_types; QByteArray encoding; xcb_atom_t a = mimeAtomForFormat(c, QLatin1String(format), requestedType, atoms, &encoding); if (a == XCB_NONE) |