[PATCH] D49591: [clangd] Introduce search Tokens and trigram generation algorithms

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 24 06:52:22 PDT 2018


kbobyrev added inline comments.


================
Comment at: clang-tools-extra/clangd/index/dex/Trigram.cpp:38
+                 llvm::makeMutableArrayRef(Roles.data(), Identifier.size()));
+  std::transform(begin(Identifier), end(Identifier), begin(Identifier),
+                 ::tolower);
----------------
sammccall wrote:
> nit: seems clearer to call `tolower` inline rather than mutating the input param - "identifier" doesn't really describe its new value
As discussed offline, I think it might be more efficient to copy apply `toLower` once instead of doing that up to 8 times more.


https://reviews.llvm.org/D49591





More information about the cfe-commits mailing list