[clang-tools-extra] 6bb5d6a - [NFC] Use a move instead of a copy to optimize performance. (#118699)

via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 6 04:54:32 PST 2024


Author: Zahira Ammarguellat
Date: 2024-12-06T07:54:27-05:00
New Revision: 6bb5d6ae23cace42bd108ca14e17e863c73bbb5c

URL: https://github.com/llvm/llvm-project/commit/6bb5d6ae23cace42bd108ca14e17e863c73bbb5c
DIFF: https://github.com/llvm/llvm-project/commit/6bb5d6ae23cace42bd108ca14e17e863c73bbb5c.diff

LOG: [NFC] Use a move instead of a copy to optimize performance. (#118699)

This is an issue detected by a static analysis tool,

Added: 
    

Modified: 
    clang-tools-extra/clangd/ModulesBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/ModulesBuilder.cpp b/clang-tools-extra/clangd/ModulesBuilder.cpp
index 29508901f85bba..bee31fe51555e0 100644
--- a/clang-tools-extra/clangd/ModulesBuilder.cpp
+++ b/clang-tools-extra/clangd/ModulesBuilder.cpp
@@ -199,7 +199,7 @@ bool IsModuleFileUpToDate(PathRef ModuleFilePath,
 
   SourceManager SourceMgr(*Diags, FileMgr);
 
-  HeaderSearch HeaderInfo(HSOpts, SourceMgr, *Diags, LangOpts,
+  HeaderSearch HeaderInfo(std::move(HSOpts), SourceMgr, *Diags, LangOpts,
                           /*Target=*/nullptr);
 
   TrivialModuleLoader ModuleLoader;


        


More information about the cfe-commits mailing list