Skip to content

Commit 7344188

Browse files
committedFeb 28, 2019
Use ArrayRef::copy, instead of copying data manually
Reviewers: ioeric Subscribers: jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58782 llvm-svn: 355091
1 parent cb83ea6 commit 7344188

File tree

1 file changed

+1
-3
lines changed
  • clang-tools-extra/clangd/index

1 file changed

+1
-3
lines changed
 

‎clang-tools-extra/clangd/index/Ref.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ RefSlab RefSlab::Builder::build() && {
5151
SymRefs.erase(std::unique(SymRefs.begin(), SymRefs.end()), SymRefs.end());
5252

5353
NumRefs += SymRefs.size();
54-
auto *Array = Arena.Allocate<Ref>(SymRefs.size());
55-
std::uninitialized_copy(SymRefs.begin(), SymRefs.end(), Array);
56-
Result.emplace_back(Sym.first, llvm::ArrayRef<Ref>(Array, SymRefs.size()));
54+
Result.emplace_back(Sym.first, llvm::ArrayRef<Ref>(SymRefs).copy(Arena));
5755
}
5856
return RefSlab(std::move(Result), std::move(Arena), NumRefs);
5957
}

0 commit comments

Comments
 (0)
Please sign in to comment.