[vlmc-devel] commit: SemanticObjectManager: Use QHash instead of QMap ( Hugo Beauzee-Luyssen )

git at videolan.org git at videolan.org
Sat Mar 20 17:15:38 CET 2010


vlmc | branch: master | Hugo Beauzee-Luyssen <beauze.h at gmail.com> | Sat Mar 20 17:13:54 2010 +0100| [5a7b0234415575485c3a4338f278a3f6f5fd61b0] | committer: Hugo Beauzee-Luyssen 

SemanticObjectManager: Use QHash instead of QMap

We don't need items to be ordonated.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=5a7b0234415575485c3a4338f278a3f6f5fd61b0
---

 src/EffectsEngine/SemanticObjectManager.hpp |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/EffectsEngine/SemanticObjectManager.hpp b/src/EffectsEngine/SemanticObjectManager.hpp
index 997f718..2104750 100644
--- a/src/EffectsEngine/SemanticObjectManager.hpp
+++ b/src/EffectsEngine/SemanticObjectManager.hpp
@@ -47,8 +47,8 @@ public:
     {
         if ( m_objectByName.empty() == false )
         {
-            typename QMap<QString, T*>::iterator it = m_objectByName.begin();
-            typename QMap<QString, T*>::iterator end = m_objectByName.end();
+            typename QHash<QString, T*>::iterator it = m_objectByName.begin();
+            typename QHash<QString, T*>::iterator end = m_objectByName.end();
 
             for ( ; it != end; ++it )
                 delete it.value();
@@ -153,7 +153,7 @@ public:
 
     inline bool                        deleteObject( quint32 objectId )
     {
-        typename QMap<quint32, T*>::iterator itid;
+        typename QHash<quint32, T*>::iterator itid;
 
         itid = m_objectById.find( objectId );
 
@@ -200,7 +200,7 @@ public:
 
     inline bool                        deleteObject( const QString & objectName )
     {
-        typename QMap<quint32, T*>::iterator itid;
+        typename QHash<quint32, T*>::iterator itid;
         quint32                     objectId;
 
         itid = m_objectById.find( getObjectIdByObjectName( objectName ) );
@@ -250,7 +250,7 @@ public:
 
     inline T*                          getObject( quint32 objectId ) const
     {
-        typename QMap<quint32, T*>::const_iterator    it = m_objectById.find( objectId );
+        typename QHash<quint32, T*>::const_iterator    it = m_objectById.find( objectId );
 
         if ( it != m_objectById.end() )
             return it.value();
@@ -259,7 +259,7 @@ public:
 
     inline T*                          getObject( const QString & objectName ) const
     {
-        typename QMap<QString, T*>::const_iterator    it = m_objectByName.find( objectName );
+        typename QHash<QString, T*>::const_iterator    it = m_objectByName.find( objectName );
 
         if ( it != m_objectByName.end() )
             return it.value();
@@ -273,9 +273,9 @@ public:
 
 private:
 
-    QMap<quint32, T*>           m_objectById;
-    QMap<QString, T*>           m_objectByName;
-    QMap<quint32, QString>      m_nameById;
+    QHash<quint32, T*>          m_objectById;
+    QHash<QString, T*>          m_objectByName;
+    QHash<quint32, QString>     m_nameById;
     quint32                     m_higherFreeId;
     quint32                     m_mapHoles;
     EffectNode*                 m_father;



More information about the Vlmc-devel mailing list