[PATCH] D143096: [clangd] Provide patched diagnostics with preamble patch

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 17 06:33:57 PST 2023


kadircet added a comment.

thanks for the review!



================
Comment at: clang-tools-extra/clangd/Preamble.cpp:509
+      // Check if AlternateLine matches all lines in the range.
+      if (llvm::any_of(
+              llvm::zip_equal(RangeContents,
----------------
sammccall wrote:
> why not just `if (RangeContents != CurrentLines.slice(...))`? I feel like I'm missing something subtle :-)
> 
> Also if you replace the `slice(a, b)` with `drop_front(a).take_front(b)` then you don't need the `CurrentEnd > CurrentLines.size()` check
> why not just if (RangeContents != CurrentLines.slice(...))? I feel like I'm missing something subtle :-)

no that's absolutely right, i guess i had a brain fart 😂 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143096



More information about the cfe-commits mailing list