[clang] [clang-format] Lambda parameter should be passed by const reference (PR #87306)

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 2 02:56:03 PDT 2024


================
@@ -3578,7 +3578,7 @@ cleanupAroundReplacements(StringRef Code, const tooling::Replacements &Replaces,
   // We need to use lambda function here since there are two versions of
   // `cleanup`.
   auto Cleanup = [](const FormatStyle &Style, StringRef Code,
-                    std::vector<tooling::Range> Ranges,
+                    const std::vector<tooling::Range> &Ranges,
----------------
RKSimon wrote:

Since cleanup() takes an `ArrayRef<tooling::Range>` should this also?

https://github.com/llvm/llvm-project/pull/87306


More information about the cfe-commits mailing list