diff options
author | 2016-02-01 16:40:06 -0800 | |
---|---|---|
committer | 2016-02-01 16:40:06 -0800 | |
commit | 33e51184fcb4bb021a6b2878d90a2d19c53821ff (patch) | |
tree | 74704fdd20a9bf68cc2d0c3fc9a029e711d3a102 /test/cpp/qps/driver.cc | |
parent | 0d7a070e7e51f87bbcdaf72b5a25d0430f82093b (diff) |
Address reviewer comments regarding const and shortage of comments
Diffstat (limited to 'test/cpp/qps/driver.cc')
-rw-r--r-- | test/cpp/qps/driver.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc index 57b85b107f..9eef4076d9 100644 --- a/test/cpp/qps/driver.cc +++ b/test/cpp/qps/driver.cc @@ -65,7 +65,7 @@ static std::string get_host(const std::string& worker) { char* port; gpr_split_host_port(worker.c_str(), &host, &port); - string s(host); + const string s(host); gpr_free(host); gpr_free(port); @@ -76,7 +76,7 @@ static std::unordered_map<string, std::deque<int>> get_hosts_and_cores( const deque<string>& workers) { std::unordered_map<string, std::deque<int>> hosts; for (auto it = workers.begin(); it != workers.end(); it++) { - string host = get_host(*it); + const string host = get_host(*it); if (hosts.find(host) == hosts.end()) { auto stub = WorkerService::NewStub( CreateChannel(*it, InsecureChannelCredentials())); @@ -149,7 +149,7 @@ std::unique_ptr<ScenarioResult> RunScenario( // To be added to the result, containing the final configuration used for // client and config (including host, etc.) ClientConfig result_client_config; - ServerConfig result_server_config = initial_server_config; + const ServerConfig result_server_config = initial_server_config; // Get client, server lists auto workers = get_workers("QPS_WORKERS"); @@ -224,7 +224,7 @@ std::unique_ptr<ScenarioResult> RunScenario( if (server_core_limit == 0 && client_core_limit > 0) { // In this case, limit the server cores if it matches the // same host as one or more clients - const auto& dq = hosts_cores[host_str]; + const auto& dq = hosts_cores.at(host_str); bool match = false; int limit = dq.size(); for (size_t cli = 0; cli < num_clients; cli++) { @@ -239,7 +239,7 @@ std::unique_ptr<ScenarioResult> RunScenario( } } if (server_core_limit > 0) { - auto& dq = hosts_cores[host_str]; + auto& dq = hosts_cores.at(host_str); GPR_ASSERT(dq.size() >= static_cast<size_t>(server_core_limit)); for (int core = 0; core < server_core_limit; core++) { server_config.add_core_list(dq.front()); |