[clang-tools-extra] 5a25854 - [clangd] Construct SmallVector with ArrayRef (NFC) (#105829)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 23 08:45:32 PDT 2024
Author: Kazu Hirata
Date: 2024-08-23T08:45:29-07:00
New Revision: 5a25854ed18ec5a51df6d1f7a2366a574a6846b0
URL: https://github.com/llvm/llvm-project/commit/5a25854ed18ec5a51df6d1f7a2366a574a6846b0
DIFF: https://github.com/llvm/llvm-project/commit/5a25854ed18ec5a51df6d1f7a2366a574a6846b0.diff
LOG: [clangd] Construct SmallVector with ArrayRef (NFC) (#105829)
Added:
Modified:
clang-tools-extra/clangd/TUScheduler.cpp
Removed:
################################################################################
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());
More information about the cfe-commits
mailing list