[clangd] Use 'const Twine&' instead of 'Twine'. NFC
authorIlya Biryukov <ibiryukov@google.com>
Thu, 26 Jul 2018 16:13:52 +0000 (16:13 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Thu, 26 Jul 2018 16:13:52 +0000 (16:13 +0000)
To fix clang-tidy warning

llvm-svn: 338037

clang-tools-extra/clangd/Threading.cpp
clang-tools-extra/clangd/Threading.h

index bd2c12e..aa9dd8f 100644 (file)
@@ -50,7 +50,7 @@ bool AsyncTaskRunner::wait(Deadline D) const {
                       [&] { return InFlightTasks == 0; });
 }
 
-void AsyncTaskRunner::runAsync(llvm::Twine Name,
+void AsyncTaskRunner::runAsync(const llvm::Twine &Name,
                                llvm::unique_function<void()> Action) {
   {
     std::lock_guard<std::mutex> Lock(Mutex);
index 61e02e6..6dad841 100644 (file)
@@ -108,7 +108,7 @@ public:
   void wait() const { (void)wait(Deadline::infinity()); }
   LLVM_NODISCARD bool wait(Deadline D) const;
   // The name is used for tracing and debugging (e.g. to name a spawned thread).
-  void runAsync(llvm::Twine Name, llvm::unique_function<void()> Action);
+  void runAsync(const llvm::Twine &Name, llvm::unique_function<void()> Action);
 
 private:
   mutable std::mutex Mutex;