QmlJS: Improve performance by avoiding two links in SemanticHighlighter.

Reviewed-by: Roberto Raggi
This commit is contained in:
Christian Kamm
2010-08-31 10:39:07 +02:00
parent 2e8ec2f9e6
commit f3f3b96c85
3 changed files with 6 additions and 8 deletions

View File

@@ -154,10 +154,10 @@ public:
} // end of anonymous namespace
Check::Check(Document::Ptr doc, const Snapshot &snapshot, const QStringList &importPaths)
Check::Check(Document::Ptr doc, const Snapshot &snapshot, const Context *linkedContextNoScope)
: _doc(doc)
, _snapshot(snapshot)
, _link(&_context, doc, snapshot, importPaths)
, _context(*linkedContextNoScope)
, _scopeBuilder(doc, &_context)
, _ignoreTypeErrors(false)
{
@@ -171,7 +171,6 @@ QList<DiagnosticMessage> Check::operator()()
{
_messages.clear();
Node::accept(_doc->ast(), this);
_messages.append(_link.diagnosticMessages());
return _messages;
}