Declare change set and compositor structs as movable primative types.
authorAndrew den Exter <andrew.den-exter@nokia.com>
Fri, 9 Mar 2012 01:02:03 +0000 (11:02 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 13 Mar 2012 01:02:49 +0000 (02:02 +0100)
Allows QVector to avoid invoking contructors for these types
unnecessarily.

Change-Id: Icc8670e4a033c943666f907c7e1b006a3d205597
Reviewed-by: Bea Lam <bea.lam@nokia.com>
src/quick/util/qquickchangeset_p.h
src/quick/util/qquicklistcompositor_p.h

index 6417966..04a1e77 100644 (file)
@@ -152,6 +152,11 @@ private:
     int m_difference;
 };
 
+Q_DECLARE_TYPEINFO(QQuickChangeSet::Change, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QQuickChangeSet::Remove, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QQuickChangeSet::Insert, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QQuickChangeSet::MoveKey, Q_PRIMITIVE_TYPE);
+
 inline uint qHash(const QQuickChangeSet::MoveKey &key) { return qHash(qMakePair(key.moveId, key.offset)); }
 inline bool operator ==(const QQuickChangeSet::MoveKey &l, const QQuickChangeSet::MoveKey &r) {
     return l.moveId == r.moveId && l.offset == r.offset; }
index b12ee80..5c9d679 100644 (file)
@@ -317,6 +317,10 @@ private:
     friend Q_AUTOTEST_EXPORT QDebug operator <<(QDebug debug, const QQuickListCompositor &list);
 };
 
+Q_DECLARE_TYPEINFO(QQuickListCompositor::Change, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QQuickListCompositor::Remove, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QQuickListCompositor::Insert, Q_PRIMITIVE_TYPE);
+
 inline QQuickListCompositor::iterator::iterator()
     : range(0), offset(0), group(Default), groupCount(0) {}
 inline QQuickListCompositor::iterator::iterator(const iterator &it)