From 5717a3c60dd3c200a653302d7f6c18b69a615288 Mon Sep 17 00:00:00 2001 From: Woongsuk Date: Thu, 6 Mar 2025 10:00:12 +0900 Subject: [PATCH] Fix coverity issue add & keyword to avoid object copying --- NativeLauncher/tool/ni_common.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NativeLauncher/tool/ni_common.cc b/NativeLauncher/tool/ni_common.cc index 9bd09ad..2a78afc 100644 --- a/NativeLauncher/tool/ni_common.cc +++ b/NativeLauncher/tool/ni_common.cc @@ -1341,7 +1341,7 @@ ni_error_e regeneratePkgNI(NIOption* opt, bool removeOnly) std::sort(pkgList.begin(), pkgList.end()); pkgList.erase(unique(pkgList.begin(), pkgList.end()), pkgList.end()); - for (const auto pkg : pkgList) { + for (const auto& pkg : pkgList) { if (isReadOnlyPkg(pkg) && opt->flags & NI_FLAGS_SKIP_RO_APP) { continue; } @@ -1413,7 +1413,7 @@ static int regenTacCb(pkgmgrinfo_appinfo_h handle, void *userData) nugetPaths += concatPath(__DOTNET_DIR, nuget); } - for (auto& nuget : nugets) { + for (const auto& nuget : nugets) { createNIUnderTAC(concatPath(__DOTNET_DIR, nuget), nugetPaths, *pOpt); } -- 2.34.1