[clang] [NFC][Clang] Use range for loops in ClangDiagnosticsEmitter (PR #115573)

Rahul Joshi via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 12 08:04:45 PST 2024


================
@@ -970,10 +942,11 @@ struct DiagTextPrinter : DiagTextVisitor<DiagTextPrinter> {
   void VisitPlural(PluralPiece *P) {
     Result += "%plural{";
     assert(P->Options.size() == P->OptionPrefixes.size());
-    for (unsigned I = 0, End = P->Options.size(); I < End; ++I) {
-      if (P->OptionPrefixes[I])
-        Visit(P->OptionPrefixes[I]);
-      Visit(P->Options[I]);
+    for (const auto &[Prefix, Option] :
----------------
jurahul wrote:

I see. Yeah, then the additional & is not useful. Will remove it

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


More information about the cfe-commits mailing list