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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user