QMimeData: replace an inefficient QList with a QVector

QMimeDataStruct is larger than a pointer, so holding it in a
QList is horribly inefficient.

Fix by marking as movable and holding in a QVector instead.

Change-Id: If285dd31546066db0b240ea0d4d30668f50b5f2c
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
Marc Mutz 2014-08-09 02:27:31 +02:00
parent e60079a55c
commit 09d6bbebc2

View File

@ -53,6 +53,7 @@ struct QMimeDataStruct
QString format;
QVariant data;
};
Q_DECLARE_TYPEINFO(QMimeDataStruct, Q_MOVABLE_TYPE);
class QMimeDataPrivate : public QObjectPrivate
{
@ -64,7 +65,7 @@ public:
QVariant retrieveTypedData(const QString &format, QVariant::Type type) const;
QList<QMimeDataStruct> dataList;
QVector<QMimeDataStruct> dataList;
};
void QMimeDataPrivate::removeData(const QString &format)