QmlJS: Change from QMap to QHash for QString keys.

Tests indicate that lookup in QHash<QString, ...> is more performant
even for short strings.

Change-Id: I8e5a73d0f1a72e202522f397b16901887f9c3591
Reviewed-on: http://codereview.qt-project.org/5070
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
This commit is contained in:
Christian Kamm
2011-09-16 10:35:48 +02:00
parent 3503731abd
commit f8462cca65
10 changed files with 15 additions and 16 deletions

View File

@@ -131,7 +131,7 @@ private:
static bool matchesMimeType(const Core::MimeType &fileMimeType, const Core::MimeType &knownMimeType);
static void updateCppQmlTypes(ModelManager *qmlModelManager,
CPlusPlus::CppModelManagerInterface *cppModelManager,
QMap<QString, QPair<CPlusPlus::Document::Ptr, bool> > documents);
QHash<QString, QPair<CPlusPlus::Document::Ptr, bool> > documents);
mutable QMutex m_mutex;
Core::ICore *m_core;
@@ -143,7 +143,7 @@ private:
QFutureSynchronizer<void> m_synchronizer;
QTimer *m_updateCppQmlTypesTimer;
QMap<QString, QPair<CPlusPlus::Document::Ptr, bool> > m_queuedCppDocuments;
QHash<QString, QPair<CPlusPlus::Document::Ptr, bool> > m_queuedCppDocuments;
CppDataHash m_cppDataHash;
mutable QMutex m_cppDataMutex;