[PATCH] D95942: [clangd] Deduplicate scopes in IncludeFixer queries

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 3 08:03:35 PST 2021


sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clangd/IncludeFixer.cpp:322
 
-  Scopes.push_back("");
+  std::set<std::string> Scopes;
+  Scopes.insert("");
----------------
nit: sort+erase-unique is probably cheaper than constructing a set and then copying it

(probably not a huge deal but we do this for each typo I think)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95942



More information about the cfe-commits mailing list