summaryrefslogtreecommitdiff
path: root/test/utils/executor/test_api_bundle.hpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-09-18 17:51:41 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-09-23 10:54:50 +0200
commitdc1db0e8b43f5e907a3ded2e39da8b58fa50a04b (patch)
tree7ca1dd20806fd71c42f875adc1c653df45b147b1 /test/utils/executor/test_api_bundle.hpp
parent6453a846e788887b6cd74d71c1873a5e3270434d (diff)
downloadjustbuild-dc1db0e8b43f5e907a3ded2e39da8b58fa50a04b.tar.gz
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.
Diffstat (limited to 'test/utils/executor/test_api_bundle.hpp')
-rw-r--r--test/utils/executor/test_api_bundle.hpp4
1 files changed, 2 insertions, 2 deletions
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<HashFunction const*> const& hash_function,
gsl::not_null<IExecutionApi::Ptr> 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