[clang-tools-extra] [clangd] Use std::make_unique (NFC) (PR #97915)

via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 6 15:08:37 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-tools-extra

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/97915.diff


1 Files Affected:

- (modified) clang-tools-extra/clangd/support/ThreadsafeFS.cpp (+1-1) 


``````````diff
diff --git a/clang-tools-extra/clangd/support/ThreadsafeFS.cpp b/clang-tools-extra/clangd/support/ThreadsafeFS.cpp
index 0e249d07d2fd9..7398e4258527b 100644
--- a/clang-tools-extra/clangd/support/ThreadsafeFS.cpp
+++ b/clang-tools-extra/clangd/support/ThreadsafeFS.cpp
@@ -41,7 +41,7 @@ class VolatileFileSystem : public llvm::vfs::ProxyFileSystem {
     llvm::StringRef FileName = llvm::sys::path::filename(Path);
     if (FileName.starts_with("preamble-") && FileName.ends_with(".pch"))
       return File;
-    return std::unique_ptr<VolatileFile>(new VolatileFile(std::move(*File)));
+    return std::make_unique<VolatileFile>(std::move(*File));
   }
 
 private:

``````````

</details>


https://github.com/llvm/llvm-project/pull/97915


More information about the cfe-commits mailing list