summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2011-09-01 09:22:50 +0200
committerChristian Kamm <christian.d.kamm@nokia.com>2011-09-01 11:27:55 +0200
commited8a7fc87c3ffd162a7045403b6471d55c03fb8b (patch)
treee45cbe0bb0ac2f81ba14e4365b0d6e25a7bd4ad2 /src/plugins
parent2bda4184789fcce2904d67b1a6ad8a1fefc5ae31 (diff)
downloadqt-creator-ed8a7fc87c3ffd162a7045403b6471d55c03fb8b.tar.gz
C++: Clean up semantic highlighter chunking code.
Change-Id: I5398442bdb864c4bccd8c193364bed3879bbc660 Reviewed-on: http://codereview.qt.nokia.com/4042 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/cppeditor/cppchecksymbols.cpp14
-rw-r--r--src/plugins/cppeditor/cppchecksymbols.h2
2 files changed, 2 insertions, 14 deletions
diff --git a/src/plugins/cppeditor/cppchecksymbols.cpp b/src/plugins/cppeditor/cppchecksymbols.cpp
index 5e05fe655d..304da93f5e 100644
--- a/src/plugins/cppeditor/cppchecksymbols.cpp
+++ b/src/plugins/cppeditor/cppchecksymbols.cpp
@@ -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())
diff --git a/src/plugins/cppeditor/cppchecksymbols.h b/src/plugins/cppeditor/cppchecksymbols.h
index 0827d0a5db..9a742cdd4a 100644
--- a/src/plugins/cppeditor/cppchecksymbols.h
+++ b/src/plugins/cppeditor/cppchecksymbols.h
@@ -169,8 +169,6 @@ private:
QList<AST *> _astStack;
QVector<Use> _usages;
unsigned _lineOfLastUsage;
- bool _flushRequested;
- unsigned _flushLine;
};
} // namespace CPlusPlus