summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/local/local_api.hpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-06-20 16:30:38 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-06-25 13:59:48 +0200
commitf1b92cf45f0ea07f22965ab6d9bca5fcd97e03a8 (patch)
tree8e198e81ee501b324f7fd4292a5f8835363bdea1 /src/buildtool/execution_api/local/local_api.hpp
parent5b3ee91c84d37fe2cd7d4ddd9d26370447564161 (diff)
downloadjustbuild-f1b92cf45f0ea07f22965ab6d9bca5fcd97e03a8.tar.gz
Pass IExecutionApi to IExecutionApi by reference
...instead of not_null const ptr.
Diffstat (limited to 'src/buildtool/execution_api/local/local_api.hpp')
-rw-r--r--src/buildtool/execution_api/local/local_api.hpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/buildtool/execution_api/local/local_api.hpp b/src/buildtool/execution_api/local/local_api.hpp
index fc64e842..928fb5b8 100644
--- a/src/buildtool/execution_api/local/local_api.hpp
+++ b/src/buildtool/execution_api/local/local_api.hpp
@@ -78,8 +78,9 @@ class LocalApi final : public IExecutionApi {
[[nodiscard]] auto RetrieveToPaths(
std::vector<Artifact::ObjectInfo> const& artifacts_info,
std::vector<std::filesystem::path> const& output_paths,
- std::optional<gsl::not_null<IExecutionApi*>> const& /*alternative*/ =
- std::nullopt) const noexcept -> bool final {
+ std::optional<
+ gsl::not_null<const IExecutionApi*>> const& /*alternative*/
+ = std::nullopt) const noexcept -> bool final {
if (artifacts_info.size() != output_paths.size()) {
Logger::Log(LogLevel::Error,
"different number of digests and output paths.");
@@ -171,10 +172,9 @@ class LocalApi final : public IExecutionApi {
// NOLINTNEXTLINE(misc-no-recursion)
[[nodiscard]] auto RetrieveToCas(
std::vector<Artifact::ObjectInfo> const& artifacts_info,
- gsl::not_null<IExecutionApi*> const& api) const noexcept -> bool final {
-
+ IExecutionApi const& api) const noexcept -> bool final {
// Return immediately if target CAS is this CAS
- if (this == api) {
+ if (this == &api) {
return true;
}
@@ -237,15 +237,15 @@ class LocalApi final : public IExecutionApi {
IsExecutableObject(info.type)},
/*exception_is_fatal=*/true,
[&api](ArtifactBlobContainer&& blobs) {
- return api->Upload(std::move(blobs),
- /*skip_find_missing=*/true);
+ return api.Upload(std::move(blobs),
+ /*skip_find_missing=*/true);
})) {
return false;
}
}
// Upload remaining blobs to remote CAS.
- return api->Upload(std::move(container), /*skip_find_missing=*/true);
+ return api.Upload(std::move(container), /*skip_find_missing=*/true);
}
[[nodiscard]] auto RetrieveToMemory(
@@ -299,7 +299,7 @@ class LocalApi final : public IExecutionApi {
if (Compatibility::IsCompatible()) {
return CommonUploadTreeCompatible(
- this,
+ *this,
*build_root,
[&cas = storage_->CAS()](
std::vector<bazel_re::Digest> const& digests,
@@ -313,7 +313,7 @@ class LocalApi final : public IExecutionApi {
});
}
- return CommonUploadTreeNative(this, *build_root);
+ return CommonUploadTreeNative(*this, *build_root);
}
[[nodiscard]] auto IsAvailable(ArtifactDigest const& digest) const noexcept