summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/common
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2025-02-14 13:04:28 +0100
committerMaksim Denisov <denisov.maksim@huawei.com>2025-02-19 17:50:30 +0100
commit56df7b3916f669edd315808f92e63e7553367f1d (patch)
tree93a269402da87f33a9e95f82e540f6fef667aa6b /src/buildtool/execution_api/common
parent888573c86e2eff6d1657f42955c388cda347680d (diff)
downloadjustbuild-56df7b3916f669edd315808f92e63e7553367f1d.tar.gz
Store HashFunction by value
Although references give an additional information about ownership, they introduce additional design difficulties.
Diffstat (limited to 'src/buildtool/execution_api/common')
-rw-r--r--src/buildtool/execution_api/common/api_bundle.cpp6
-rw-r--r--src/buildtool/execution_api/common/api_bundle.hpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/buildtool/execution_api/common/api_bundle.cpp b/src/buildtool/execution_api/common/api_bundle.cpp
index fa559f7f..69b628bc 100644
--- a/src/buildtool/execution_api/common/api_bundle.cpp
+++ b/src/buildtool/execution_api/common/api_bundle.cpp
@@ -29,7 +29,7 @@ auto ApiBundle::Create(
gsl::not_null<LocalContext const*> const& local_context,
gsl::not_null<RemoteContext const*> const& remote_context,
RepositoryConfig const* repo_config) -> ApiBundle {
- auto const& hash_fct = local_context->storage_config->hash_function;
+ HashFunction const hash_fct = local_context->storage_config->hash_function;
IExecutionApi::Ptr local_api =
std::make_shared<LocalApi>(local_context, repo_config);
IExecutionApi::Ptr remote_api = local_api;
@@ -42,7 +42,7 @@ auto ApiBundle::Create(
remote_context->auth,
remote_context->retry_config,
config,
- &hash_fct);
+ hash_fct);
}
return ApiBundle{.hash_function = hash_fct,
.local = std::move(local_api),
@@ -63,7 +63,7 @@ auto ApiBundle::MakeRemote(
authentication,
retry_config,
config,
- &hash_function);
+ hash_function);
}
return local;
}
diff --git a/src/buildtool/execution_api/common/api_bundle.hpp b/src/buildtool/execution_api/common/api_bundle.hpp
index 19146f66..a08e7bba 100644
--- a/src/buildtool/execution_api/common/api_bundle.hpp
+++ b/src/buildtool/execution_api/common/api_bundle.hpp
@@ -51,7 +51,7 @@ struct ApiBundle final {
gsl::not_null<RetryConfig const*> const& retry_config) const
-> gsl::not_null<IExecutionApi::Ptr>;
- HashFunction const& hash_function;
+ HashFunction const hash_function;
gsl::not_null<IExecutionApi::Ptr> const local;
gsl::not_null<IExecutionApi::Ptr> const remote;
};