From dbac8a19685b83dd1d656201da900a20e11428f2 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Mon, 24 Jun 2024 12:20:32 +0200 Subject: Introduce a type allias for an optional ptr to IExecutionApi ...and replace verbose constructions. --- src/other_tools/ops_maps/archive_fetch_map.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src/other_tools/ops_maps/archive_fetch_map.cpp') diff --git a/src/other_tools/ops_maps/archive_fetch_map.cpp b/src/other_tools/ops_maps/archive_fetch_map.cpp index 883ffa76..db2fc319 100644 --- a/src/other_tools/ops_maps/archive_fetch_map.cpp +++ b/src/other_tools/ops_maps/archive_fetch_map.cpp @@ -26,14 +26,13 @@ namespace { -void ProcessContent( - std::filesystem::path const& content_path, - std::filesystem::path const& target_name, - gsl::not_null const& local_api, - std::optional> const& remote_api, - std::string const& content, - ArchiveFetchMap::SetterPtr const& setter, - ArchiveFetchMap::LoggerPtr const& logger) { +void ProcessContent(std::filesystem::path const& content_path, + std::filesystem::path const& target_name, + gsl::not_null const& local_api, + IExecutionApi::OptionalPtr const& remote_api, + std::string const& content, + ArchiveFetchMap::SetterPtr const& setter, + ArchiveFetchMap::LoggerPtr const& logger) { // try to back up to remote CAS if (remote_api) { if (not local_api->RetrieveToCas( @@ -68,12 +67,11 @@ void ProcessContent( } // namespace -auto CreateArchiveFetchMap( - gsl::not_null const& content_cas_map, - std::filesystem::path const& fetch_dir, - gsl::not_null const& local_api, - std::optional> const& remote_api, - std::size_t jobs) -> ArchiveFetchMap { +auto CreateArchiveFetchMap(gsl::not_null const& content_cas_map, + std::filesystem::path const& fetch_dir, + gsl::not_null const& local_api, + IExecutionApi::OptionalPtr const& remote_api, + std::size_t jobs) -> ArchiveFetchMap { auto fetch_archive = [content_cas_map, fetch_dir, local_api, remote_api]( auto ts, auto setter, -- cgit v1.2.3