diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-24 12:20:32 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-25 13:59:48 +0200 |
commit | dbac8a19685b83dd1d656201da900a20e11428f2 (patch) | |
tree | 311ecff8b9498f3753d2df83b95d7301f11d90d8 /src/other_tools/ops_maps/archive_fetch_map.cpp | |
parent | f77492425703122c9b977ba3e0f9f5fdd80a08d1 (diff) | |
download | justbuild-dbac8a19685b83dd1d656201da900a20e11428f2.tar.gz |
Introduce a type allias for an optional ptr to IExecutionApi
...and replace verbose constructions.
Diffstat (limited to 'src/other_tools/ops_maps/archive_fetch_map.cpp')
-rw-r--r-- | src/other_tools/ops_maps/archive_fetch_map.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
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<IExecutionApi const*> const& local_api, - std::optional<gsl::not_null<IExecutionApi const*>> 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<IExecutionApi const*> 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<ContentCASMap*> const& content_cas_map, - std::filesystem::path const& fetch_dir, - gsl::not_null<IExecutionApi const*> const& local_api, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, - std::size_t jobs) -> ArchiveFetchMap { +auto CreateArchiveFetchMap(gsl::not_null<ContentCASMap*> const& content_cas_map, + std::filesystem::path const& fetch_dir, + gsl::not_null<IExecutionApi const*> 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, |