From 3f75861a2d60fc5a2fd9c9894267f1df72f66c47 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 25 Jun 2024 16:47:10 +0200 Subject: Use a raw pointer for passing optional RepositoryConfig ...instead of std::optional>. --- src/buildtool/execution_api/common/api_bundle.cpp | 5 ++--- src/buildtool/execution_api/common/api_bundle.hpp | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'src/buildtool/execution_api/common') diff --git a/src/buildtool/execution_api/common/api_bundle.cpp b/src/buildtool/execution_api/common/api_bundle.cpp index bbcaa3b5..488fc25d 100644 --- a/src/buildtool/execution_api/common/api_bundle.cpp +++ b/src/buildtool/execution_api/common/api_bundle.cpp @@ -18,9 +18,8 @@ #include "src/buildtool/execution_api/local/local_api.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_api.hpp" -ApiBundle::ApiBundle( - std::optional> const& repo_config, - std::optional const& remote_address) +ApiBundle::ApiBundle(RepositoryConfig const* repo_config, + std::optional const& remote_address) : local{std::make_shared(repo_config)}, remote{CreateRemote(remote_address)} {} diff --git a/src/buildtool/execution_api/common/api_bundle.hpp b/src/buildtool/execution_api/common/api_bundle.hpp index 58a80677..53e59de2 100644 --- a/src/buildtool/execution_api/common/api_bundle.hpp +++ b/src/buildtool/execution_api/common/api_bundle.hpp @@ -27,10 +27,8 @@ /// same time. If the remote api cannot be instantiated, it falls back to /// exactly the same instance that local api is (&*remote == & *local). struct ApiBundle final { - explicit ApiBundle( - std::optional> const& - repo_config, - std::optional const& remote_address); + explicit ApiBundle(RepositoryConfig const* repo_config, + std::optional const& remote_address); [[nodiscard]] auto CreateRemote(std::optional const& address) const -> gsl::not_null; -- cgit v1.2.3