ResourcesDB: added nameHash property in order to avoid unnecessary

string comparisons (now comparing two int's before comparing two whole
string objects)
This commit is contained in:
Tobias Doerffel
2009-02-27 00:01:38 +01:00
parent 57c7c64103
commit 9ebdc72404
2 changed files with 16 additions and 3 deletions

View File

@@ -84,6 +84,7 @@ public:
int _size = -1,
const QDateTime & _last_mod = QDateTime() ) :
m_name( _name ),
m_nameHash( 0 ),
m_type( _type ),
m_baseDir( _base_dir ),
m_path( _path ),
@@ -98,6 +99,7 @@ public:
Item() :
m_name(),
m_nameHash( 0 ),
m_type( TypeUnknown ),
m_baseDir( BaseRoot ),
m_path(),
@@ -116,6 +118,11 @@ public:
return m_name;
}
inline int nameHash( void ) const
{
return m_nameHash;
}
Types type( void ) const
{
return m_type;
@@ -206,6 +213,7 @@ public:
void init( void );
QString m_name;
int m_nameHash;
Types m_type;
BaseDirectories m_baseDir;
QString m_path;