[PATCH] D51088: [clangd] Get rid of regexes in CanonicalIncludes

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 22 06:18:12 PDT 2018


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


================
Comment at: clangd/index/CanonicalIncludes.cpp:24
+  int Components = 0;
+  for (auto It = llvm::sys::path::begin(Suffix),
+            End = llvm::sys::path::end(Suffix);
----------------
Would `int Components = begin(Suffix)  - end(Suffix);` work here?


================
Comment at: clangd/index/CanonicalIncludes.cpp:79
+       It != End; ++It) {
+    ++Components;
+    if (MaxSuffixComponents < Components)
----------------
Maybe merge `Components` and break condition into `for loop` condition?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D51088





More information about the cfe-commits mailing list