From: Woongsuk Date: Thu, 6 Mar 2025 01:00:12 +0000 (+0900) Subject: Fix coverity issue X-Git-Tag: accepted/tizen/unified/20250310.024604^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5717a3c60dd3c200a653302d7f6c18b69a615288;p=platform%2Fcore%2Fdotnet%2Flauncher.git Fix coverity issue add & keyword to avoid object copying --- 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); }