summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcompletionassist.cpp
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2014-11-06 09:35:29 +0100
committerhjk <hjk121@nokiamail.com>2014-11-06 16:13:58 +0100
commitca151d07fa6d97039fed95dcabe206fce41f5769 (patch)
tree77b2e92a9fc01a074d3debdb0300d28337b8cf19 /src/plugins/cpptools/cppcompletionassist.cpp
parentcb1d040c327f5c8ed8a188e6227ef0e131a3271b (diff)
downloadqt-creator-ca151d07fa6d97039fed95dcabe206fce41f5769.tar.gz
CPlusPlus: Use QVector<Token> instead of QList
Better suited to avoid the indirection (sizeof(Token) > sizeof(void *)) Change-Id: Ia5f42781e720ef6aa8161f8f81ae8ddd8e58c837 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Diffstat (limited to 'src/plugins/cpptools/cppcompletionassist.cpp')
-rw-r--r--src/plugins/cpptools/cppcompletionassist.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp
index cf17e742e5..44743977d4 100644
--- a/src/plugins/cpptools/cppcompletionassist.cpp
+++ b/src/plugins/cpptools/cppcompletionassist.cpp
@@ -387,7 +387,7 @@ int CppFunctionHintModel::activeArgument(const QString &prefix) const
int argnr = 0;
int parcount = 0;
SimpleLexer tokenize;
- QList<Token> tokens = tokenize(prefix);
+ Tokens tokens = tokenize(prefix);
for (int i = 0; i < tokens.count(); ++i) {
const Token &tk = tokens.at(i);
if (tk.is(T_LPAREN))
@@ -686,7 +686,7 @@ bool CppCompletionAssistProcessor::accepts() const
tokenize.setLanguageFeatures(features);
tokenize.setSkipComments(false);
- const QList<Token> &tokens = tokenize(tc.block().text(), BackwardsScanner::previousBlockState(tc.block()));
+ const Tokens &tokens = tokenize(tc.block().text(), BackwardsScanner::previousBlockState(tc.block()));
const int tokenIdx = SimpleLexer::tokenBefore(tokens, qMax(0, tc.positionInBlock() - 1));
const Token tk = (tokenIdx == -1) ? Token() : tokens.at(tokenIdx);
@@ -789,7 +789,7 @@ int CppCompletionAssistProcessor::startOfOperator(int pos,
SimpleLexer tokenize;
tokenize.setLanguageFeatures(m_languageFeatures);
tokenize.setSkipComments(false);
- const QList<Token> &tokens = tokenize(tc.block().text(), BackwardsScanner::previousBlockState(tc.block()));
+ const Tokens &tokens = tokenize(tc.block().text(), BackwardsScanner::previousBlockState(tc.block()));
const int tokenIdx = SimpleLexer::tokenBefore(tokens, qMax(0, tc.positionInBlock() - 1)); // get the token at the left of the cursor
const Token tk = (tokenIdx == -1) ? Token() : tokens.at(tokenIdx);