diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2017-12-28 14:47:01 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2017-12-28 14:47:01 +0000 |
| commit | 50a967d601749beceaaf901b5931fa0a96fb17df (patch) | |
| tree | 777be211e0d63150be78b8b043a1e3fa53063410 /clang-tools-extra/clangd/index/Index.cpp | |
| parent | 314981bacde7a1c681928ddd2a813a5b0ab09c95 (diff) | |
| download | bcm5719-llvm-50a967d601749beceaaf901b5931fa0a96fb17df.tar.gz bcm5719-llvm-50a967d601749beceaaf901b5931fa0a96fb17df.zip | |
[clangd] Simplify code. No functionality change intended.
llvm-svn: 321523
Diffstat (limited to 'clang-tools-extra/clangd/index/Index.cpp')
| -rw-r--r-- | clang-tools-extra/clangd/index/Index.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
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<StringRef> &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<char>(V.size()); - memcpy(Data, V.data(), V.size()); - *R.first = StringRef(Data, V.size()); + *R.first = V.copy(Arena); } V = *R.first; }; |

