diff options
author | Shafik Yaghmour <shafik.yaghmour@intel.com> | 2025-05-01 12:06:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-01 12:06:49 -0700 |
commit | d7f98a4ef9992936a92c2a71fec743ea6f3493d0 (patch) | |
tree | d93b0966b3f675edce96cdb304e22d8177ee14e1 /clang/lib/Lex/ModuleMap.cpp | |
parent | a60984ec8d8eb84fd087ed1bcf2ebfb6512ae20d (diff) | |
download | llvm-d7f98a4ef9992936a92c2a71fec743ea6f3493d0.zip llvm-d7f98a4ef9992936a92c2a71fec743ea6f3493d0.tar.gz llvm-d7f98a4ef9992936a92c2a71fec743ea6f3493d0.tar.bz2 |
[Clang][NFC] Use std::move to avoid copy (#138073)
Static analysis flagged this code for using copy when we could use
std::move.
Worth noting that CD.Message is a StringRef but Conflict.Message is
std::string. Otherwise I would have used a temporary in place and avoid
a local variable.
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r-- | clang/lib/Lex/ModuleMap.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index 74fe55f..c2f13fa 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -2010,7 +2010,8 @@ void ModuleMapLoader::handleConflict(const modulemap::ConflictDecl &CD) { Conflict.Id = CD.Id; Conflict.Message = CD.Message; - ActiveModule->UnresolvedConflicts.push_back(Conflict); + // FIXME: when we move to C++20 we should consider using emplace_back + ActiveModule->UnresolvedConflicts.push_back(std::move(Conflict)); } void ModuleMapLoader::handleInferredModuleDecl( |