From 39042cd9add0608a16d706f8ecdf11c2cd6bf1e2 Mon Sep 17 00:00:00 2001 From: Ilho Kim Date: Mon, 29 Jan 2024 21:00:20 +0900 Subject: [PATCH] Fix static analysis issue Use of auto that causes a copy Change-Id: Id308b78bc42bba876c4f83d85f407ed4e4a0ce1a Signed-off-by: Ilho Kim --- src/common/step/filesystem/step_change_ownership_and_permission.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/step/filesystem/step_change_ownership_and_permission.cc b/src/common/step/filesystem/step_change_ownership_and_permission.cc index 48be8b6..7b8013c 100644 --- a/src/common/step/filesystem/step_change_ownership_and_permission.cc +++ b/src/common/step/filesystem/step_change_ownership_and_permission.cc @@ -95,7 +95,7 @@ bool GrantDefaultPermissions(bf::path pkg_path, bool skip_symlink) { } for (auto& entry : boost::make_iterator_range(bf::directory_iterator(pkg_path), {})) { - auto path = entry.path(); + const auto& path = entry.path(); if (skip_symlink && bf::is_symlink(symlink_status(path))) continue; @@ -111,7 +111,7 @@ bool GrantDefaultPermissions(bf::path pkg_path, bool skip_symlink) { return false; for (auto& bin_entry : boost::make_iterator_range(bf::directory_iterator(path), {})) { - auto bin_path = bin_entry.path(); + const auto& bin_path = bin_entry.path(); if (bf::is_symlink(symlink_status(bin_path))) continue; @@ -128,7 +128,7 @@ bool GrantDefaultPermissions(bf::path pkg_path, bool skip_symlink) { return false; for (auto& lib_entry : boost::make_iterator_range(bf::directory_iterator(path), {})) { - auto lib_path = lib_entry.path(); + const auto& lib_path = lib_entry.path(); if (bf::is_symlink(symlink_status(lib_path))) continue; -- 2.7.4