[clang] [NFC] Use `const&` avoiding copies (PR #90334)

Danny Mösch via cfe-commits cfe-commits at lists.llvm.org
Sat May 4 08:58:32 PDT 2024


https://github.com/SimplyDanny updated https://github.com/llvm/llvm-project/pull/90334

>From e8420d3d39d729ee83e187913bb3a8d790f5779d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Danny=20M=C3=B6sch?= <danny.moesch at icloud.com>
Date: Sat, 27 Apr 2024 11:38:20 +0200
Subject: [PATCH] [NFC] Use const& avoiding copies

---
 clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp b/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp
index d58f5bb0919906..f8dced5dbafb60 100644
--- a/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp
+++ b/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp
@@ -295,7 +295,7 @@ class InterfaceStubFunctionsConsumer : public ASTConsumer {
       OS << "Symbols:\n";
       for (const auto &E : Symbols) {
         const MangledSymbol &Symbol = E.second;
-        for (auto Name : Symbol.Names) {
+        for (const auto &Name : Symbol.Names) {
           OS << "  - { Name: \""
              << (Symbol.ParentName.empty() || Instance.getLangOpts().CPlusPlus
                      ? ""



More information about the cfe-commits mailing list