diff options
author | Noah Eisen <ncteisen@gmail.com> | 2018-06-15 10:43:49 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-15 10:43:49 -0400 |
commit | bd6ac0f9d57dda96797bbd5b1bd27815342e7ee5 (patch) | |
tree | c7880206cfa219be7356a10e0aaec978733aab7b /src/cpp | |
parent | c65066666f964f656cd6c0f3e0d830c0c12875e8 (diff) | |
parent | 8e75b48bcdaf2d0c91220c855c7a8c3d7d62221d (diff) |
Merge pull request #15681 from ncteisen/even-more-clang
Even More Clang Tidy: performance-*
Diffstat (limited to 'src/cpp')
-rw-r--r-- | src/cpp/server/server_builder.cc | 4 | ||||
-rw-r--r-- | src/cpp/server/server_cc.cc | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index 7f5b439dfb..5d1919cd1d 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -24,6 +24,8 @@ #include <grpcpp/resource_quota.h> #include <grpcpp/server.h> +#include <utility> + #include "src/core/lib/gpr/useful.h" #include "src/cpp/server/thread_pool_interface.h" @@ -166,7 +168,7 @@ ServerBuilder& ServerBuilder::AddListeningPort( while (addr_uri[pos] == '/') ++pos; // Skip slashes. addr = addr_uri.substr(pos); } - Port port = {addr, creds, selected_port}; + Port port = {addr, std::move(creds), selected_port}; ports_.push_back(port); return *this; } diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 391ca44962..0d77510e29 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -219,7 +219,7 @@ class Server::SyncRequest final : public internal::CompletionQueueTag { } } - void Run(std::shared_ptr<GlobalCallbacks> global_callbacks) { + void Run(const std::shared_ptr<GlobalCallbacks>& global_callbacks) { ctx_.BeginCompletionOp(&call_); global_callbacks->PreSynchronousRequest(&ctx_); method_->handler()->RunHandler(internal::MethodHandler::HandlerParameter( @@ -272,7 +272,7 @@ class Server::SyncRequestThreadManager : public ThreadManager { server_(server), server_cq_(server_cq), cq_timeout_msec_(cq_timeout_msec), - global_callbacks_(global_callbacks) {} + global_callbacks_(std::move(global_callbacks)) {} WorkStatus PollForWork(void** tag, bool* ok) override { *tag = nullptr; @@ -378,7 +378,7 @@ Server::Server( sync_server_cqs, int min_pollers, int max_pollers, int sync_cq_timeout_msec) : max_receive_message_size_(max_receive_message_size), - sync_server_cqs_(sync_server_cqs), + sync_server_cqs_(std::move(sync_server_cqs)), started_(false), shutdown_(false), shutdown_notified_(false), |