Commit 5a7b0234 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

SemanticObjectManager: Use QHash instead of QMap

We don't need items to be ordonated.
parent dbcfa3a6
...@@ -47,8 +47,8 @@ public: ...@@ -47,8 +47,8 @@ public:
{ {
if ( m_objectByName.empty() == false ) if ( m_objectByName.empty() == false )
{ {
typename QMap<QString, T*>::iterator it = m_objectByName.begin(); typename QHash<QString, T*>::iterator it = m_objectByName.begin();
typename QMap<QString, T*>::iterator end = m_objectByName.end(); typename QHash<QString, T*>::iterator end = m_objectByName.end();
for ( ; it != end; ++it ) for ( ; it != end; ++it )
delete it.value(); delete it.value();
...@@ -153,7 +153,7 @@ public: ...@@ -153,7 +153,7 @@ public:
inline bool deleteObject( quint32 objectId ) inline bool deleteObject( quint32 objectId )
{ {
typename QMap<quint32, T*>::iterator itid; typename QHash<quint32, T*>::iterator itid;
itid = m_objectById.find( objectId ); itid = m_objectById.find( objectId );
...@@ -200,7 +200,7 @@ public: ...@@ -200,7 +200,7 @@ public:
inline bool deleteObject( const QString & objectName ) inline bool deleteObject( const QString & objectName )
{ {
typename QMap<quint32, T*>::iterator itid; typename QHash<quint32, T*>::iterator itid;
quint32 objectId; quint32 objectId;
itid = m_objectById.find( getObjectIdByObjectName( objectName ) ); itid = m_objectById.find( getObjectIdByObjectName( objectName ) );
...@@ -250,7 +250,7 @@ public: ...@@ -250,7 +250,7 @@ public:
inline T* getObject( quint32 objectId ) const 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() ) if ( it != m_objectById.end() )
return it.value(); return it.value();
...@@ -259,7 +259,7 @@ public: ...@@ -259,7 +259,7 @@ public:
inline T* getObject( const QString & objectName ) const 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() ) if ( it != m_objectByName.end() )
return it.value(); return it.value();
...@@ -273,9 +273,9 @@ public: ...@@ -273,9 +273,9 @@ public:
private: private:
QMap<quint32, T*> m_objectById; QHash<quint32, T*> m_objectById;
QMap<QString, T*> m_objectByName; QHash<QString, T*> m_objectByName;
QMap<quint32, QString> m_nameById; QHash<quint32, QString> m_nameById;
quint32 m_higherFreeId; quint32 m_higherFreeId;
quint32 m_mapHoles; quint32 m_mapHoles;
EffectNode* m_father; EffectNode* m_father;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment