diff options
author | Kim Gräsman <kim.grasman@gmail.com> | 2023-03-12 19:51:55 +0100 |
---|---|---|
committer | Kim Gräsman <kim.grasman@gmail.com> | 2023-03-12 19:51:55 +0100 |
commit | 50c28ed4d074a207dab99b7003584c6bc3c16e11 (patch) | |
tree | 0530f96e55853b61894b81390bbfedefd192c992 | |
parent | a346c2de63e678a64f61ce695eb0b735f688f5b6 (diff) |
Simplify TraverseNestedNameSpecifierLoc slightly
We might as well store the NNS-pointer in a temporary to simplify and
harmonize the following code (almost exactly the same as
TraverseNestedNameSpecifier now, save for base call).
-rw-r--r-- | iwyu.cc | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -393,13 +393,13 @@ class BaseAstVisitor : public RecursiveASTVisitor<Derived> { } bool TraverseNestedNameSpecifierLoc(NestedNameSpecifierLoc nns_loc) { - if (!nns_loc) + NestedNameSpecifier* nns = nns_loc.getNestedNameSpecifier(); + if (!nns) return true; ASTNode node(&nns_loc); CurrentASTNodeUpdater canu(¤t_ast_node_, &node); // TODO(csilvers): have VisitNestedNameSpecifierLoc instead. - if (!this->getDerived().VisitNestedNameSpecifier( - nns_loc.getNestedNameSpecifier())) + if (!this->getDerived().VisitNestedNameSpecifier(nns)) return false; return Base::TraverseNestedNameSpecifierLoc(nns_loc); } |