https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/105829
None >From 3fbc8e818867ef7ac950a381f98ff013089d8e96 Mon Sep 17 00:00:00 2001 From: Kazu Hirata <k...@google.com> Date: Fri, 23 Aug 2024 06:24:44 -0700 Subject: [PATCH] [clangd] Construct SmallVector with ArrayRef (NFC) --- clang-tools-extra/clangd/TUScheduler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits