diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2009-11-10 15:12:04 +0100 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-11-10 16:20:12 +0100 |
commit | 380bce45276e2bff94dcd4453e5d65ffa53bd385 (patch) | |
tree | 56e541b869943b9fc218391b4d0b00dafd531868 /src/shared/cplusplus/AST.cpp | |
parent | b47eee88695ab5ea499a0197a779e37ad745fd5d (diff) | |
download | qt-creator-380bce45276e2bff94dcd4453e5d65ffa53bd385.tar.gz |
Cleanup nested name specifiers
Diffstat (limited to 'src/shared/cplusplus/AST.cpp')
-rw-r--r-- | src/shared/cplusplus/AST.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/shared/cplusplus/AST.cpp b/src/shared/cplusplus/AST.cpp index 30ba2cba5a..4286cc8dff 100644 --- a/src/shared/cplusplus/AST.cpp +++ b/src/shared/cplusplus/AST.cpp @@ -1299,12 +1299,10 @@ unsigned PointerToMemberAST::lastToken() const if (star_token) return star_token + 1; - for (NestedNameSpecifierAST *it = nested_name_specifier; it; it = it->next) { - if (! it->next) - return it->lastToken(); - } + else if (nested_name_specifier) + return nested_name_specifier->lastToken(); - if (global_scope_token) + else if (global_scope_token) return global_scope_token + 1; return 0; @@ -1349,10 +1347,8 @@ unsigned QualifiedNameAST::lastToken() const if (unqualified_name) return unqualified_name->lastToken(); - for (NestedNameSpecifierAST *it = nested_name_specifier; it; it = it->next) { - if (! it->next) - return it->lastToken(); - } + if (nested_name_specifier) + return nested_name_specifier->lastToken(); if (global_scope_token) return global_scope_token + 1; |