summaryrefslogtreecommitdiff
path: root/src/other_tools/ops_maps/archive_fetch_map.cpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-06-25 16:14:51 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-06-27 11:24:20 +0200
commit4625d391cad4d04f9adca4484da687b2adb1fed6 (patch)
tree4f4a3e19e78324e6abe3a6ac1209cad3d8a50cb0 /src/other_tools/ops_maps/archive_fetch_map.cpp
parent70a854c2ce90194a943b6e007a1515dfc87314eb (diff)
downloadjustbuild-4625d391cad4d04f9adca4484da687b2adb1fed6.tar.gz
Use a raw pointer for passing optional IExecutionApi
...instead of std::optional<gsl::not_null<IExecutionApi const*>>
Diffstat (limited to 'src/other_tools/ops_maps/archive_fetch_map.cpp')
-rw-r--r--src/other_tools/ops_maps/archive_fetch_map.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/other_tools/ops_maps/archive_fetch_map.cpp b/src/other_tools/ops_maps/archive_fetch_map.cpp
index db2fc319..e035b128 100644
--- a/src/other_tools/ops_maps/archive_fetch_map.cpp
+++ b/src/other_tools/ops_maps/archive_fetch_map.cpp
@@ -29,17 +29,17 @@ namespace {
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,
+ IExecutionApi 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 (remote_api != nullptr) {
if (not local_api->RetrieveToCas(
{Artifact::ObjectInfo{
.digest = ArtifactDigest{content, 0, /*is_tree=*/false},
.type = ObjectType::File}},
- **remote_api)) {
+ *remote_api)) {
// give a warning
(*logger)(fmt::format("Failed to back up content {} from local CAS "
"to remote",
@@ -70,7 +70,7 @@ void ProcessContent(std::filesystem::path const& content_path,
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,
+ IExecutionApi const* remote_api,
std::size_t jobs) -> ArchiveFetchMap {
auto fetch_archive = [content_cas_map, fetch_dir, local_api, remote_api](
auto ts,