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/root_maps/content_git_map.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/other_tools/root_maps/content_git_map.cpp') diff --git a/src/other_tools/root_maps/content_git_map.cpp b/src/other_tools/root_maps/content_git_map.cpp index 4052b963..440593d0 100644 --- a/src/other_tools/root_maps/content_git_map.cpp +++ b/src/other_tools/root_maps/content_git_map.cpp @@ -52,14 +52,13 @@ namespace { /// root if it was marked absent. /// It guarantees the logger is called exactly once with fatal on failure, and /// the setter on success. -void EnsureRootAsAbsent( - std::string const& tree_id, - ArchiveRepoInfo const& key, - std::optional const& serve, - std::optional> const& remote_api, - bool is_cache_hit, - ContentGitMap::SetterPtr const& ws_setter, - ContentGitMap::LoggerPtr const& logger) { +void EnsureRootAsAbsent(std::string const& tree_id, + ArchiveRepoInfo const& key, + std::optional const& serve, + IExecutionApi::OptionalPtr const& remote_api, + bool is_cache_hit, + ContentGitMap::SetterPtr const& ws_setter, + ContentGitMap::LoggerPtr const& logger) { // this is an absent root if (serve) { // check if the serve endpoint has this root @@ -176,7 +175,7 @@ void ResolveContentTree( bool is_cache_hit, bool is_absent, std::optional const& serve, - std::optional> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, gsl::not_null const& critical_git_op_map, gsl::not_null const& resolve_symlinks_map, gsl::not_null const& ts, @@ -365,7 +364,7 @@ void WriteIdFileAndSetWSRoot( std::filesystem::path const& archive_tree_id_file, bool is_absent, std::optional const& serve, - std::optional> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, gsl::not_null const& critical_git_op_map, gsl::not_null const& resolve_symlinks_map, gsl::not_null const& ts, @@ -426,7 +425,7 @@ void ExtractAndImportToGit( std::filesystem::path const& archive_tree_id_file, bool is_absent, std::optional const& serve, - std::optional> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, gsl::not_null const& critical_git_op_map, gsl::not_null const& import_to_git_map, gsl::not_null const& resolve_symlinks_map, @@ -510,7 +509,7 @@ auto CreateContentGitMap( gsl::not_null const& resolve_symlinks_map, gsl::not_null const& critical_git_op_map, std::optional const& serve, - std::optional> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, bool fetch_absent, std::size_t jobs) -> ContentGitMap { auto gitify_content = [content_cas_map, -- cgit v1.2.3