diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-25 16:14:51 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-27 11:24:20 +0200 |
commit | 4625d391cad4d04f9adca4484da687b2adb1fed6 (patch) | |
tree | 4f4a3e19e78324e6abe3a6ac1209cad3d8a50cb0 /src/buildtool/execution_api/remote/bazel/bazel_api.cpp | |
parent | 70a854c2ce90194a943b6e007a1515dfc87314eb (diff) | |
download | justbuild-4625d391cad4d04f9adca4484da687b2adb1fed6.tar.gz |
Use a raw pointer for passing optional IExecutionApi
...instead of std::optional<gsl::not_null<IExecutionApi const*>>
Diffstat (limited to 'src/buildtool/execution_api/remote/bazel/bazel_api.cpp')
-rw-r--r-- | src/buildtool/execution_api/remote/bazel/bazel_api.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp index f636c265..aea38ab4 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp @@ -221,7 +221,7 @@ auto BazelApi::CreateAction( [[nodiscard]] auto BazelApi::RetrieveToPaths( std::vector<Artifact::ObjectInfo> const& artifacts_info, std::vector<std::filesystem::path> const& output_paths, - IExecutionApi::OptionalPtr const& alternative) const noexcept -> bool { + IExecutionApi const* alternative) const noexcept -> bool { if (artifacts_info.size() != output_paths.size()) { Logger::Log(LogLevel::Warning, "different number of digests and output paths."); @@ -233,16 +233,15 @@ auto BazelApi::CreateAction( std::vector<std::size_t> artifact_pos{}; for (std::size_t i{}; i < artifacts_info.size(); ++i) { auto const& info = artifacts_info[i]; - if (alternative and alternative.value()->IsAvailable(info.digest)) { - if (not alternative.value()->RetrieveToPaths({info}, - {output_paths[i]})) { + if (alternative != nullptr and alternative->IsAvailable(info.digest)) { + if (not alternative->RetrieveToPaths({info}, {output_paths[i]})) { return false; } } else { if (IsTreeObject(info.type)) { // read object infos from sub tree and call retrieve recursively - auto request_remote_tree = alternative.has_value() + auto request_remote_tree = alternative != nullptr ? std::make_optional(info.digest) : std::nullopt; auto reader = TreeReader<BazelNetworkReader>{ |