[clang-tools-extra] [clangd] Construct SmallVector with ArrayRef (NFC) (PR #105829)

via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 23 06:37:29 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/105829.diff


1 Files Affected:

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


``````````diff
diff --git a/clang-tools-extra/clangd/TUScheduler.cpp b/clang-tools-extra/clangd/TUScheduler.cpp
index 324ba1fc8cb895..71548b59cc3088 100644
--- a/clang-tools-extra/clangd/TUScheduler.cpp
+++ b/clang-tools-extra/clangd/TUScheduler.cpp
@@ -1838,7 +1838,7 @@ DebouncePolicy::compute(llvm::ArrayRef<clock::duration> History) const {
   // Base the result on the median rebuild.
   // nth_element needs a mutable array, take the chance to bound the data size.
   History = History.take_back(15);
-  llvm::SmallVector<clock::duration, 15> Recent(History.begin(), History.end());
+  llvm::SmallVector<clock::duration, 15> Recent(History);
   auto *Median = Recent.begin() + Recent.size() / 2;
   std::nth_element(Recent.begin(), Median, Recent.end());
 

``````````

</details>


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


More information about the cfe-commits mailing list