From 56df7b3916f669edd315808f92e63e7553367f1d Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Fri, 14 Feb 2025 13:04:28 +0100 Subject: Store HashFunction by value Although references give an additional information about ownership, they introduce additional design difficulties. --- src/buildtool/execution_api/common/api_bundle.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/buildtool/execution_api/common/api_bundle.cpp') 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 const& local_context, gsl::not_null 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(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; } -- cgit v1.2.3