[llvm] [Support] Use range-based for loops (NFC) (PR #169001)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 21 08:14:43 PST 2025


================
@@ -602,8 +602,7 @@ static Option *LookupNearestOption(StringRef Arg,
   // Find the closest match.
   Option *Best = nullptr;
   unsigned BestDistance = 0;
-  for (const auto &Opt : OptionsMap) {
-    Option *O = Opt.second;
+  for (const auto &[Key, O] : OptionsMap) {
----------------
kuhar wrote:

```suggestion
  for (const auto &[_Key, O] : OptionsMap) {
```
I think key is unused, and the usual way to denote that is with a leading underscore

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


More information about the llvm-commits mailing list