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/buildtool/file_system/object_cas.test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/buildtool/file_system/object_cas.test.cpp') diff --git a/test/buildtool/file_system/object_cas.test.cpp b/test/buildtool/file_system/object_cas.test.cpp index 6f06eea4..1872f25b 100644 --- a/test/buildtool/file_system/object_cas.test.cpp +++ b/test/buildtool/file_system/object_cas.test.cpp @@ -34,7 +34,7 @@ TEST_CASE("ObjectCAS", "[file_system]") { storage_config.Get().hash_function, test_content); SECTION("CAS for files") { - ObjectCAS cas{storage_config.Get().hash_function, + ObjectCAS cas{&storage_config.Get().hash_function, gen_config.cas_f}; CHECK(not cas.BlobPath(test_digest)); @@ -74,7 +74,7 @@ TEST_CASE("ObjectCAS", "[file_system]") { SECTION("CAS for executables") { ObjectCAS cas{ - storage_config.Get().hash_function, gen_config.cas_x}; + &storage_config.Get().hash_function, gen_config.cas_x}; CHECK(not cas.BlobPath(test_digest)); SECTION("Add blob from bytes and verify") { -- cgit v1.2.3