diff --git a/clang-tools-extra/clangd/index/Ref.cpp b/clang-tools-extra/clangd/index/Ref.cpp --- a/clang-tools-extra/clangd/index/Ref.cpp +++ b/clang-tools-extra/clangd/index/Ref.cpp @@ -51,9 +51,7 @@ SymRefs.erase(std::unique(SymRefs.begin(), SymRefs.end()), SymRefs.end()); NumRefs += SymRefs.size(); - auto *Array = Arena.Allocate(SymRefs.size()); - std::uninitialized_copy(SymRefs.begin(), SymRefs.end(), Array); - Result.emplace_back(Sym.first, llvm::ArrayRef(Array, SymRefs.size())); + Result.emplace_back(Sym.first, llvm::ArrayRef(SymRefs).copy(Arena)); } return RefSlab(std::move(Result), std::move(Arena), NumRefs); }