From 50a967d601749beceaaf901b5931fa0a96fb17df Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 28 Dec 2017 14:47:01 +0000 Subject: [clangd] Simplify code. No functionality change intended. llvm-svn: 321523 --- clang-tools-extra/clangd/index/Index.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'clang-tools-extra/clangd/index/Index.cpp') diff --git a/clang-tools-extra/clangd/index/Index.cpp b/clang-tools-extra/clangd/index/Index.cpp index 95348582739..6d26dc849d2 100644 --- a/clang-tools-extra/clangd/index/Index.cpp +++ b/clang-tools-extra/clangd/index/Index.cpp @@ -29,10 +29,6 @@ void operator>>(StringRef Str, SymbolID &ID) { std::copy(HexString.begin(), HexString.end(), ID.HashValue.begin()); } -SymbolSlab::const_iterator SymbolSlab::begin() const { return Symbols.begin(); } - -SymbolSlab::const_iterator SymbolSlab::end() const { return Symbols.end(); } - SymbolSlab::const_iterator SymbolSlab::find(const SymbolID &ID) const { auto It = std::lower_bound(Symbols.begin(), Symbols.end(), ID, [](const Symbol &S, const SymbolID &I) { @@ -50,9 +46,7 @@ static void own(Symbol &S, DenseSet &Strings, auto Intern = [&](StringRef &V) { auto R = Strings.insert(V); if (R.second) { // New entry added to the table, copy the string. - char *Data = Arena.Allocate(V.size()); - memcpy(Data, V.data(), V.size()); - *R.first = StringRef(Data, V.size()); + *R.first = V.copy(Arena); } V = *R.first; }; -- cgit v1.2.3