diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-18 17:51:41 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-23 10:54:50 +0200 |
commit | dc1db0e8b43f5e907a3ded2e39da8b58fa50a04b (patch) | |
tree | 7ca1dd20806fd71c42f875adc1c653df45b147b1 /test/buildtool/execution_api/bazel | |
parent | 6453a846e788887b6cd74d71c1873a5e3270434d (diff) | |
download | justbuild-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/buildtool/execution_api/bazel')
-rw-r--r-- | test/buildtool/execution_api/bazel/bazel_api.test.cpp | 2 | ||||
-rw-r--r-- | test/buildtool/execution_api/bazel/bazel_network.test.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/test/buildtool/execution_api/bazel/bazel_api.test.cpp b/test/buildtool/execution_api/bazel/bazel_api.test.cpp index 16c45aae..e201111c 100644 --- a/test/buildtool/execution_api/bazel/bazel_api.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_api.test.cpp @@ -46,7 +46,7 @@ class FactoryApi final { &auth_, &retry_config, {}, - hash_function_}}; + &hash_function_}}; } private: diff --git a/test/buildtool/execution_api/bazel/bazel_network.test.cpp b/test/buildtool/execution_api/bazel/bazel_network.test.cpp index 8224de74..e5dab868 100644 --- a/test/buildtool/execution_api/bazel/bazel_network.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_network.test.cpp @@ -55,7 +55,7 @@ TEST_CASE("Bazel network: write/read blobs", "[execution_api]") { &*auth_config, &retry_config, {}, - hash_function}; + &hash_function}; std::string content_foo("foo"); std::string content_bar("bar"); @@ -119,7 +119,7 @@ TEST_CASE("Bazel network: read blobs with unknown size", "[execution_api]") { &*auth_config, &retry_config, {}, - hash_function}; + &hash_function}; std::string content_foo("foo"); std::string content_bar(kLargeSize, 'x'); // single larger blob |