From 380bce45276e2bff94dcd4453e5d65ffa53bd385 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 10 Nov 2009 15:12:04 +0100 Subject: Cleanup nested name specifiers --- src/shared/cplusplus/AST.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/shared/cplusplus/AST.cpp') 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; -- cgit v1.2.1