Commit ed8a7fc8 authored by Christian Kamm's avatar Christian Kamm

C++: Clean up semantic highlighter chunking code.

Change-Id: I5398442bdb864c4bccd8c193364bed3879bbc660
Reviewed-on: http://codereview.qt.nokia.com/4042Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@nokia.com>
parent 2bda4184
......@@ -300,8 +300,6 @@ CheckSymbols::CheckSymbols(Document::Ptr doc, const LookupContext &context)
_potentialMembers = collectTypes.members();
_potentialVirtualMethods = collectTypes.virtualMethods();
_potentialStatics = collectTypes.statics();
_flushRequested = false;
_flushLine = 0;
typeOfExpression.init(_doc, _context.snapshot(), _context.bindings());
}
......@@ -847,20 +845,14 @@ void CheckSymbols::addUse(const Use &use)
if (!use.line)
return;
_lineOfLastUsage = qMax(_lineOfLastUsage, use.line);
if (! enclosingFunctionDefinition()) {
if (_usages.size() >= chunkSize) {
if (_flushRequested && use.line > _flushLine) {
if (use.line > _lineOfLastUsage)
flush();
_lineOfLastUsage = use.line;
} else if (! _flushRequested) {
_flushRequested = true;
_flushLine = _lineOfLastUsage;
}
}
}
_lineOfLastUsage = qMax(_lineOfLastUsage, use.line);
_usages.append(use);
}
......@@ -1102,8 +1094,6 @@ static bool sortByLinePredicate(const CheckSymbols::Use &lhs, const CheckSymbols
void CheckSymbols::flush()
{
_flushRequested = false;
_flushLine = 0;
_lineOfLastUsage = 0;
if (_usages.isEmpty())
......
......@@ -169,8 +169,6 @@ private:
QList<AST *> _astStack;
QVector<Use> _usages;
unsigned _lineOfLastUsage;
bool _flushRequested;
unsigned _flushLine;
};
} // namespace CPlusPlus
......
Markdown is supported
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