aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Noah Eisen <ncteisen@google.com>2018-06-07 22:17:14 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2018-06-14 14:58:09 -0400
commit58e0cbf9fb67186ee67be5bb71aba36e9cfebe7f (patch)
tree36a6e9fc3beb37ab4030d50375bebf7e6673c1a1 /src
parent33b77eee7890b7e8a00b256eb501d476feae09db (diff)
Enable the performance-* clang-tidy checks
Diffstat (limited to 'src')
-rw-r--r--src/cpp/server/server_builder.cc4
-rw-r--r--src/cpp/server/server_cc.cc6
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),