summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Gräsman <kim.grasman@gmail.com>2023-03-12 19:51:55 +0100
committerKim Gräsman <kim.grasman@gmail.com>2023-03-12 19:51:55 +0100
commit50c28ed4d074a207dab99b7003584c6bc3c16e11 (patch)
tree0530f96e55853b61894b81390bbfedefd192c992
parenta346c2de63e678a64f61ce695eb0b735f688f5b6 (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.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/iwyu.cc b/iwyu.cc
index 8089dab..32bff77 100644
--- a/iwyu.cc
+++ b/iwyu.cc
@@ -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(&current_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);
}