diff options
author | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2009-02-10 17:37:18 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2009-02-10 17:41:04 +0100 |
commit | a33ae02927f8266da669830b67bf84854241d61c (patch) | |
tree | 289c7caf99c14aa4d7387bef2d93f048a938e319 /src/plugins/cpptools | |
parent | 146a534932b66af491f6cce014095a480d1790b3 (diff) | |
download | qt-creator-a33ae02927f8266da669830b67bf84854241d61c.tar.gz |
Revert now unnecessary checks for null-types
This reverts commits:
c721304a4731a91a9e143a54d2ab3ef89526e05e
885d908ea336de72e7fce2141c1060e425f2af0a
a0909989f7d71ee754cdb61202a519cabff25f7c
fb4ad59ddbf727f13f29df6bcff80a88e1e1a319
0a9a67cf547701a278f19dbe2b9fb0a70a36cdb8
0d1624d4d1d5ce4e350476fbc86a361fad2ef6b8
d018cfd5cb4aad0101c321fe2fcf9b21598e9590
0504fdd00bce8d9580a52335093b57215f4272da
a2fd10fe193dbf8369e43d7df9a59503c8853b2b
Conflicts:
src/plugins/cpptools/cppcodecompletion.cpp
Reviewed-by: Roberto Raggi
Diffstat (limited to 'src/plugins/cpptools')
-rw-r--r-- | src/plugins/cpptools/cppcodecompletion.cpp | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index dcf41e3e74..f9ea3b0bbe 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -578,8 +578,6 @@ bool CppCodeCompletion::completeFunction(FullySpecifiedType exprTy, QSet<QString> signatures; foreach (TypeOfExpression::Result p, resolvedTypes) { FullySpecifiedType ty = p.first; - if (! ty) - continue; if (Function *fun = ty->asFunctionType()) { if (TextEditor::CompletionItem item = toCompletionItem(fun)) { QString signature; @@ -602,7 +600,7 @@ bool CppCodeCompletion::completeFunction(FullySpecifiedType exprTy, bool CppCodeCompletion::completeMember(const QList<TypeOfExpression::Result> &results, const LookupContext &context) { - if (results.isEmpty() || ! results.first().first) + if (results.isEmpty()) return false; TypeOfExpression::Result result = results.first(); @@ -898,10 +896,7 @@ bool CppCodeCompletion::completeConstructors(Class *klass) for (unsigned i = 0; i < klass->memberCount(); ++i) { Symbol *member = klass->memberAt(i); - FullySpecifiedType memberTy = member->type(); - if (! memberTy) - continue; - else if (! memberTy->isFunctionType()) + if (! member->type()->isFunctionType()) continue; else if (! member->identity()) continue; @@ -935,12 +930,8 @@ bool CppCodeCompletion::completeQtMethod(CPlusPlus::FullySpecifiedType, QSet<QString> signatures; foreach (TypeOfExpression::Result p, results) { FullySpecifiedType ty = p.first; - if (! ty) - continue; - if (ReferenceType *refTy = ty->asReferenceType()) ty = refTy->elementType(); - if (PointerType *ptrTy = ty->asPointerType()) ty = ptrTy->elementType(); else @@ -968,8 +959,6 @@ bool CppCodeCompletion::completeQtMethod(CPlusPlus::FullySpecifiedType, for (unsigned i = 0; i < scope->symbolCount(); ++i) { Symbol *member = scope->symbolAt(i); - if (! member->type()) - continue; Function *fun = member->type()->asFunctionType(); if (! fun) continue; @@ -1127,15 +1116,13 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item) extraChars += QLatin1Char('('); // If the function takes no arguments, automatically place the closing parenthesis - if (function->argumentCount() == 0 || (function->argumentCount() == 1 && - function->argumentAt(0)->type() && + if (function->argumentCount() == 0 || (function->argumentCount() == 1 && function->argumentAt(0)->type()->isVoidType())) { extraChars += QLatin1Char(')'); // If the function doesn't return anything, automatically place the semicolon, // unless we're doing a scope completion (then it might be function definition). - FullySpecifiedType retTy = function->returnType(); - if (retTy && retTy->isVoidType() && m_completionOperator != T_COLON_COLON) { + if (function->returnType()->isVoidType() && m_completionOperator != T_COLON_COLON) { extraChars += QLatin1Char(';'); } } |