From acc40ed0a747ad8f5dbb93788da7ce104c36c0a3 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Thu, 1 May 2025 09:52:09 -0700 Subject: [Clang][NFC] Use const auto & to avoid copy (#138069) Static analysis flagged this code as causing a copy when we never modify ModName and therefore we can use const auto & and avoid copying. --- clang/lib/Lex/ModuleMap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Lex/ModuleMap.cpp') diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index a1394fd..74fe55f 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -1959,7 +1959,7 @@ void ModuleMapLoader::handleExportDecl(const modulemap::ExportDecl &ED) { } void ModuleMapLoader::handleExportAsDecl(const modulemap::ExportAsDecl &EAD) { - auto ModName = EAD.Id.front(); + const auto &ModName = EAD.Id.front(); if (!ActiveModule->ExportAsModule.empty()) { if (ActiveModule->ExportAsModule == ModName.first) { -- cgit v1.1