From dc1db0e8b43f5e907a3ded2e39da8b58fa50a04b Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Wed, 18 Sep 2024 17:51:41 +0200 Subject: Store HashFunction by const reference. Despite the fact that HashFunction is a small type, it still makes sense to store it by reference to reflect the ownership. StorageConfig becomes the main holder. Reference holders store HashFunction by const ref and aren't allowed to change it. However, they are free to return HashFunction by value since this doesn't benefit readability anyhow. --- test/utils/executor/test_api_bundle.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/utils/executor/test_api_bundle.hpp') diff --git a/test/utils/executor/test_api_bundle.hpp b/test/utils/executor/test_api_bundle.hpp index 1b582ce6..088c4323 100644 --- a/test/utils/executor/test_api_bundle.hpp +++ b/test/utils/executor/test_api_bundle.hpp @@ -26,10 +26,10 @@ /// implementation. As only the hash_function field is actually needed, the /// remote_context and repo_config are not needed to be provided. [[nodiscard]] static auto CreateTestApiBundle( - HashFunction hash_function, + gsl::not_null const& hash_function, gsl::not_null const& api) noexcept -> ApiBundle { return ApiBundle{ - .hash_function = hash_function, .local = api, .remote = api}; + .hash_function = *hash_function, .local = api, .remote = api}; } #endif // INCLUDED_SRC_TEST_UTILS_EXECUTOR_TEST_API_BUNDLE_HPP -- cgit v1.2.3