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/just_mr/fetch.cpp | 51 +++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 26 deletions(-) (limited to 'src/other_tools/just_mr/fetch.cpp') diff --git a/src/other_tools/just_mr/fetch.cpp b/src/other_tools/just_mr/fetch.cpp index 47c107f3..a31368b9 100644 --- a/src/other_tools/just_mr/fetch.cpp +++ b/src/other_tools/just_mr/fetch.cpp @@ -439,41 +439,40 @@ auto MultiRepoFetch(std::shared_ptr const& config, auto crit_git_op_ptr = std::make_shared(); auto critical_git_op_map = CreateCriticalGitOpMap(crit_git_op_ptr); - auto content_cas_map = CreateContentCASMap( - common_args.just_mr_paths, - common_args.alternative_mirrors, - common_args.ca_info, - &critical_git_op_map, - serve, + auto content_cas_map = + CreateContentCASMap(common_args.just_mr_paths, + common_args.alternative_mirrors, + common_args.ca_info, + &critical_git_op_map, + serve, + &(*apis.local), + has_remote_api ? &*apis.remote : nullptr, + common_args.jobs); + + auto archive_fetch_map = CreateArchiveFetchMap( + &content_cas_map, + *fetch_dir, &(*apis.local), - has_remote_api ? std::make_optional(&(*apis.remote)) : std::nullopt, + (fetch_args.backup_to_remote and has_remote_api) ? &*apis.remote + : nullptr, common_args.jobs); - auto archive_fetch_map = - CreateArchiveFetchMap(&content_cas_map, - *fetch_dir, - &(*apis.local), - (fetch_args.backup_to_remote and has_remote_api) - ? std::make_optional(&(*apis.remote)) - : std::nullopt, - common_args.jobs); - auto import_to_git_map = CreateImportToGitMap(&critical_git_op_map, common_args.git_path->string(), *common_args.local_launcher, common_args.jobs); - auto git_tree_fetch_map = CreateGitTreeFetchMap( - &critical_git_op_map, - &import_to_git_map, - common_args.git_path->string(), - *common_args.local_launcher, - serve, - &(*apis.local), - has_remote_api ? std::make_optional(&(*apis.remote)) : std::nullopt, - fetch_args.backup_to_remote, - common_args.jobs); + auto git_tree_fetch_map = + CreateGitTreeFetchMap(&critical_git_op_map, + &import_to_git_map, + common_args.git_path->string(), + *common_args.local_launcher, + serve, + &(*apis.local), + has_remote_api ? &*apis.remote : nullptr, + fetch_args.backup_to_remote, + common_args.jobs); // set up progress observer JustMRProgress::Instance().SetTotal(static_cast(nr_a + nr_gt)); -- cgit v1.2.3