[PATCH] D124240: [clangd][NFC] Reduce memory usage while building dex

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 22 02:50:11 PDT 2022


sammccall added inline comments.


================
Comment at: clang-tools-extra/clangd/index/dex/Dex.cpp:89
+      Result.try_emplace(Token(Token::Kind::Trigram, E.first.str()),
+                         std::move(E.second));
+    TrigramDocs.clear();
----------------
the move here does nothing, we're passing as ArrayRef

did you want to clear the map values (vectors) as you went, too?

(this gets a bit verbose, but you could pull out a function template since all 4 cases are so regular)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124240/new/

https://reviews.llvm.org/D124240



More information about the cfe-commits mailing list