Commit ed8a7fc8 authored by Christian Kamm's avatar Christian Kamm
Browse files

C++: Clean up semantic highlighter chunking code.

Change-Id: I5398442bdb864c4bccd8c193364bed3879bbc660
Reviewed-on: http://codereview.qt.nokia.com/4042


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