Skip to content

Commit d77c995

Browse files
[DebugInfo] Avoid creating a temporary instance of std::string (NFC) (#142523)
lookupTarget accepts StringRef. We don't need to create a temporary instance of std::string only to be converted back to StringRef.
1 parent 8c65f68 commit d77c995

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ Error LVBinaryReader::loadGenericTargetInfo(StringRef TheTriple,
278278
StringRef TheFeatures) {
279279
std::string TargetLookupError;
280280
const Target *TheTarget =
281-
TargetRegistry::lookupTarget(std::string(TheTriple), TargetLookupError);
281+
TargetRegistry::lookupTarget(TheTriple, TargetLookupError);
282282
if (!TheTarget)
283283
return createStringError(errc::invalid_argument, TargetLookupError.c_str());
284284

0 commit comments

Comments
 (0)