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

Zahira Ammarguellat via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 4 12:55:49 PST 2024


https://github.com/zahiraam created https://github.com/llvm/llvm-project/pull/118699

None

>From 440554df79ebc7c8971c4af928f623b13c95c6ee Mon Sep 17 00:00:00 2001
From: Zahira Ammarguellat <Zahira.Ammarguellat at intel.com>
Date: Wed, 4 Dec 2024 12:54:41 -0800
Subject: [PATCH] [NFC] Use a move instead of a copy to optimize performance.

---
 clang-tools-extra/clangd/ModulesBuilder.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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