Only preallocate 1 change listener per animation instance
authorCharles Yin <charles.yin@nokia.com>
Fri, 18 May 2012 02:04:17 +0000 (12:04 +1000)
committerQt by Nokia <qt-info@nokia.com>
Wed, 23 May 2012 03:28:00 +0000 (05:28 +0200)
In most cases, only one animation change listener is added to animation instance,
so change QPODVector's Increment parameter from 4 to 1 can save 24 bytes (8 bytes for each listener) per animation instance.

Change-Id: Iaf50016899963689f2bf84c3dd14fcd05c306d21
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
src/qml/animations/qabstractanimationjob_p.h

index e889a12..06c4857 100644 (file)
@@ -150,7 +150,7 @@ protected:
         QAbstractAnimationJob::ChangeTypes types;
         bool operator==(const ChangeListener &other) const { return listener == other.listener && types == other.types; }
     };
-    QPODVector<ChangeListener,4> changeListeners;
+    QPODVector<ChangeListener,1> changeListeners;
 
     QAbstractAnimationJob *m_nextSibling;
     QAbstractAnimationJob *m_previousSibling;