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:
parent
e60079a55c
commit
09d6bbebc2
@ -53,6 +53,7 @@ struct QMimeDataStruct
|
|||||||
QString format;
|
QString format;
|
||||||
QVariant data;
|
QVariant data;
|
||||||
};
|
};
|
||||||
|
Q_DECLARE_TYPEINFO(QMimeDataStruct, Q_MOVABLE_TYPE);
|
||||||
|
|
||||||
class QMimeDataPrivate : public QObjectPrivate
|
class QMimeDataPrivate : public QObjectPrivate
|
||||||
{
|
{
|
||||||
@ -64,7 +65,7 @@ public:
|
|||||||
|
|
||||||
QVariant retrieveTypedData(const QString &format, QVariant::Type type) const;
|
QVariant retrieveTypedData(const QString &format, QVariant::Type type) const;
|
||||||
|
|
||||||
QList<QMimeDataStruct> dataList;
|
QVector<QMimeDataStruct> dataList;
|
||||||
};
|
};
|
||||||
|
|
||||||
void QMimeDataPrivate::removeData(const QString &format)
|
void QMimeDataPrivate::removeData(const QString &format)
|
||||||
|
Loading…
Reference in New Issue
Block a user