Skip to content

Commit 4fb79bf

Browse files
committed
cleanup
1 parent 765caa4 commit 4fb79bf

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,10 @@ void UseUsingCheck::check(const MatchFinder::MatchResult &Result) {
8989
<< FixItHint::CreateRemoval(RemovalRange);
9090

9191
SmallString<128> Scratch;
92-
if (Lexer::getSpelling(MatchedDecl.getBeginLoc(), Scratch, SM, LO) ==
93-
"typedef")
94-
Diag << FixItHint::CreateRemoval(MatchedDecl.getBeginLoc());
95-
96-
Scratch.resize(0);
97-
if (Lexer::getSpelling(TokenBeforeName.getLocation(), Scratch, SM, LO) ==
98-
"typedef")
99-
Diag << FixItHint::CreateRemoval(TokenBeforeName.getLocation());
92+
for (const SourceLocation Loc :
93+
{MatchedDecl.getBeginLoc(), TokenBeforeName.getLocation()})
94+
if (Lexer::getSpelling(Loc, Scratch, SM, LO) == "typedef")
95+
Diag << FixItHint::CreateRemoval(Loc);
10096

10197
FirstTypedefName = MatchedDecl.getName();
10298
} else {

0 commit comments

Comments
 (0)