From 4625d391cad4d04f9adca4484da687b2adb1fed6 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 25 Jun 2024 16:14:51 +0200 Subject: Use a raw pointer for passing optional IExecutionApi ...instead of std::optional> --- src/other_tools/root_maps/content_git_map.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 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 440593d0..a6d0fa15 100644 --- a/src/other_tools/root_maps/content_git_map.cpp +++ b/src/other_tools/root_maps/content_git_map.cpp @@ -55,7 +55,7 @@ namespace { void EnsureRootAsAbsent(std::string const& tree_id, ArchiveRepoInfo const& key, std::optional const& serve, - IExecutionApi::OptionalPtr const& remote_api, + IExecutionApi const* remote_api, bool is_cache_hit, ContentGitMap::SetterPtr const& ws_setter, ContentGitMap::LoggerPtr const& logger) { @@ -102,7 +102,7 @@ void EnsureRootAsAbsent(std::string const& tree_id, /*fatal=*/true); return; } - if (not remote_api) { + if (remote_api == nullptr) { (*logger)( fmt::format( "Missing or incompatible remote-execution " @@ -119,7 +119,7 @@ void EnsureRootAsAbsent(std::string const& tree_id, *serve, tree_id, StorageConfig::GitRoot(), - &(*remote_api.value()), + remote_api, logger, /*no_sync_is_fatal=*/true)) { return; @@ -129,7 +129,7 @@ void EnsureRootAsAbsent(std::string const& tree_id, else { // the tree is known locally, so we can upload it to remote CAS // for the serve endpoint to retrieve it and set up the root - if (not remote_api) { + if (remote_api == nullptr) { (*logger)( fmt::format("Missing or incompatible remote-execution " "endpoint needed to sync workspace root {} " @@ -144,7 +144,7 @@ void EnsureRootAsAbsent(std::string const& tree_id, if (not EnsureAbsentRootOnServe(*serve, tree_id, StorageConfig::GitRoot(), - &(*remote_api.value()), + remote_api, logger, /*no_sync_is_fatal=*/true)) { return; @@ -175,7 +175,7 @@ void ResolveContentTree( bool is_cache_hit, bool is_absent, std::optional const& serve, - IExecutionApi::OptionalPtr const& remote_api, + IExecutionApi const* remote_api, gsl::not_null const& critical_git_op_map, gsl::not_null const& resolve_symlinks_map, gsl::not_null const& ts, @@ -364,7 +364,7 @@ void WriteIdFileAndSetWSRoot( std::filesystem::path const& archive_tree_id_file, bool is_absent, std::optional const& serve, - IExecutionApi::OptionalPtr const& remote_api, + IExecutionApi const* remote_api, gsl::not_null const& critical_git_op_map, gsl::not_null const& resolve_symlinks_map, gsl::not_null const& ts, @@ -425,7 +425,7 @@ void ExtractAndImportToGit( std::filesystem::path const& archive_tree_id_file, bool is_absent, std::optional const& serve, - IExecutionApi::OptionalPtr const& remote_api, + IExecutionApi 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, @@ -509,7 +509,7 @@ auto CreateContentGitMap( gsl::not_null const& resolve_symlinks_map, gsl::not_null const& critical_git_op_map, std::optional const& serve, - IExecutionApi::OptionalPtr const& remote_api, + IExecutionApi const* remote_api, bool fetch_absent, std::size_t jobs) -> ContentGitMap { auto gitify_content = [content_cas_map, @@ -848,7 +848,7 @@ auto CreateContentGitMap( archive_tree_id_file, /*is_absent=*/false, /*serve=*/std::nullopt, - /*remote_api=*/std::nullopt, + /*remote_api=*/nullptr, critical_git_op_map, import_to_git_map, resolve_symlinks_map, -- cgit v1.2.3