summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus/AST.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2009-11-10 15:30:16 +0100
committerRoberto Raggi <roberto.raggi@nokia.com>2009-11-10 16:20:13 +0100
commit4fc2ccf0c5af6d93b1edca95518043b84e342c67 (patch)
treecc2010cdaa07a3cdbf619de19edc8e9646339605 /src/shared/cplusplus/AST.cpp
parent1fb33e9fad0d65fb2259fb603f61bc255f19b70f (diff)
downloadqt-creator-4fc2ccf0c5af6d93b1edca95518043b84e342c67.tar.gz
Cleanup ptr operators.
Diffstat (limited to 'src/shared/cplusplus/AST.cpp')
-rw-r--r--src/shared/cplusplus/AST.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/shared/cplusplus/AST.cpp b/src/shared/cplusplus/AST.cpp
index 03531c481a..8785ad6f09 100644
--- a/src/shared/cplusplus/AST.cpp
+++ b/src/shared/cplusplus/AST.cpp
@@ -483,10 +483,8 @@ unsigned ConversionFunctionIdAST::firstToken() const
unsigned ConversionFunctionIdAST::lastToken() const
{
- for (PtrOperatorAST *it = ptr_operators; it; it = it->next) {
- if (! it->next)
- return it->lastToken();
- }
+ if (ptr_operators)
+ return ptr_operators->lastToken();
for (SpecifierAST *it = type_specifier; it; it = it->next) {
if (! it->next)
@@ -566,10 +564,8 @@ unsigned DeclaratorAST::lastToken() const
if (core_declarator)
return core_declarator->lastToken();
- for (PtrOperatorAST *it = ptr_operators; it; it = it->next) {
- if (! it->next)
- return it->lastToken();
- }
+ if (ptr_operators)
+ return ptr_operators->lastToken();
for (SpecifierAST *it = attributes; it; it = it->next) {
if (! it->next)
@@ -1176,12 +1172,10 @@ unsigned NewTypeIdAST::lastToken() const
if (new_array_declarators)
return new_array_declarators->lastToken();
- for (PtrOperatorAST *it = ptr_operators; it; it = it->next) {
- if (it->next)
- return it->lastToken();
- }
+ else if (ptr_operators)
+ return ptr_operators->lastToken();
- if (type_specifier)
+ else if (type_specifier)
return type_specifier->lastToken();
// ### assert?