Commit 60caec48 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Store the documents in an hash.

parent 14376c3c
......@@ -558,7 +558,7 @@ QStringList Snapshot::filesDependingOn(const QString &fileName) const
return deps;
}
QMap<QString, QStringList> Snapshot::dependencyTable() const
QHash<QString, QStringList> Snapshot::dependencyTable() const
{
const int N = size();
QVector<QString> files(N);
......@@ -568,7 +568,7 @@ QMap<QString, QStringList> Snapshot::dependencyTable() const
dependency_helper(files, fileIndex, includes, includeMap);
QMap<QString, QStringList> depMap;
QHash<QString, QStringList> depMap;
for (int index = 0; index < files.size(); ++index) {
QStringList deps;
......
......@@ -33,15 +33,10 @@
#include <CPlusPlusForwardDeclarations.h>
#include "Macro.h"
#include <QByteArray>
#include <QFileInfo>
#include <QList>
#include <QMap>
#include <QBitArray>
#include <QSharedPointer>
#include <QString>
#include <QStringList>
#include <QDateTime>
#include <QtCore/QSharedPointer>
#include <QtCore/QDateTime>
#include <QtCore/QHash>
#include <QtCore/QFileInfo>
namespace CPlusPlus {
......@@ -323,7 +318,7 @@ private:
class CPLUSPLUS_EXPORT Snapshot
{
typedef QMap<QString, Document::Ptr> _Base;
typedef QHash<QString, Document::Ptr> _Base;
public:
Snapshot();
......@@ -358,7 +353,7 @@ public:
QSharedPointer<NamespaceBinding> globalNamespaceBinding(Document::Ptr doc) const;
QStringList filesDependingOn(const QString &fileName) const;
QMap<QString, QStringList> dependencyTable() const;
QHash<QString, QStringList> dependencyTable() const;
private:
void simplified_helper(Document::Ptr doc, Snapshot *snapshot) const;
......
......@@ -41,8 +41,6 @@
#include <QtDebug>
using namespace CPlusPlus;
QT_BEGIN_NAMESPACE
uint qHash(const CPlusPlus::LookupItem &key)
{
......@@ -52,6 +50,13 @@ uint qHash(const CPlusPlus::LookupItem &key)
}
QT_END_NAMESPACE
uint CPlusPlus::qHash(const CPlusPlus::LookupItem &key)
{
return QT_PREPEND_NAMESPACE(qHash)(key);
}
using namespace CPlusPlus;
/////////////////////////////////////////////////////////////////////
// LookupContext
/////////////////////////////////////////////////////////////////////
......
......@@ -228,12 +228,12 @@ private:
QList<Scope *> _visibleScopes;
};
} // end of namespace CPlusPlus
uint qHash(const CPlusPlus::LookupItem &result);
} // end of namespace CPlusPlus
QT_BEGIN_NAMESPACE
uint qHash(const CPlusPlus::LookupItem &result);
QT_END_NAMESPACE
#endif // CPLUSPLUS_LOOKUPCONTEXT_H
......@@ -35,6 +35,7 @@
#include <QtCore/QObject>
#include <QtCore/QMap>
#include <QtCore/QPointer>
#include <QtCore/QStringList>
namespace ProjectExplorer {
class Project;
......
Supports Markdown
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