Skip to content

Commit 8365ba6

Browse files
[Analysis] Avoid creating a temporary instance of std::string (NFC) (#151625)
hasName takes StringRef, so we don't need to create a temporary instance of std::string.
1 parent 1d7a0fa commit 8365ba6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang/lib/Analysis/RetainSummaryManager.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ static bool isSubclass(const Decl *D,
147147

148148
static bool isExactClass(const Decl *D, StringRef ClassName) {
149149
using namespace ast_matchers;
150-
DeclarationMatcher sameClassM =
151-
cxxRecordDecl(hasName(std::string(ClassName)));
150+
DeclarationMatcher sameClassM = cxxRecordDecl(hasName(ClassName));
152151
return !(match(sameClassM, *D, D->getASTContext()).empty());
153152
}
154153

0 commit comments

Comments
 (0)