summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/remote/bazel/bazel_api.cpp
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 /src/buildtool/execution_api/remote/bazel/bazel_api.cpp
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 'src/buildtool/execution_api/remote/bazel/bazel_api.cpp')
-rw-r--r--src/buildtool/execution_api/remote/bazel/bazel_api.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp
index e42c32e7..c5d77194 100644
--- a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp
+++ b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp
@@ -184,13 +184,14 @@ namespace {
} // namespace
-BazelApi::BazelApi(std::string const& instance_name,
- std::string const& host,
- Port port,
- gsl::not_null<Auth const*> const& auth,
- gsl::not_null<RetryConfig const*> const& retry_config,
- ExecutionConfiguration const& exec_config,
- HashFunction hash_function) noexcept {
+BazelApi::BazelApi(
+ std::string const& instance_name,
+ std::string const& host,
+ Port port,
+ gsl::not_null<Auth const*> const& auth,
+ gsl::not_null<RetryConfig const*> const& retry_config,
+ ExecutionConfiguration const& exec_config,
+ gsl::not_null<HashFunction const*> const& hash_function) noexcept {
network_ = std::make_shared<BazelNetwork>(instance_name,
host,
port,