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. --- src/buildtool/execution_api/common/api_bundle.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/buildtool/execution_api/common/api_bundle.hpp') diff --git a/src/buildtool/execution_api/common/api_bundle.hpp b/src/buildtool/execution_api/common/api_bundle.hpp index 28595010..e342ce55 100644 --- a/src/buildtool/execution_api/common/api_bundle.hpp +++ b/src/buildtool/execution_api/common/api_bundle.hpp @@ -49,9 +49,7 @@ struct ApiBundle final { gsl::not_null const& retry_config) const -> gsl::not_null; - HashFunction const hash_function; - // 7 bytes of alignment. - + HashFunction const& hash_function; gsl::not_null const local; gsl::not_null const remote; }; -- cgit v1.2.3