diff options
author | Yash Tibrewal <yashkt@google.com> | 2018-11-02 15:48:57 -0700 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2018-11-02 15:56:57 -0700 |
commit | e08a2b387a0b00534cc229702c6f358cb02870ac (patch) | |
tree | ac3298bf190946f5684d40ea4be481075eade66f /src/cpp/server/server_cc.cc | |
parent | 7a08e3b679e5a63f30fda6b426d57146f9984092 (diff) |
Prefer lambda expressions over std::bind
Diffstat (limited to 'src/cpp/server/server_cc.cc')
-rw-r--r-- | src/cpp/server/server_cc.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 870ee84e3e..c031528a8f 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -268,8 +268,8 @@ class Server::SyncRequest final : public internal::CompletionQueueTag { interceptor_methods_.SetRecvMessage(request_); } - auto f = std::bind(&CallData::ContinueRunAfterInterception, this); - if (interceptor_methods_.RunInterceptors(f)) { + if (interceptor_methods_.RunInterceptors( + [this]() { ContinueRunAfterInterception(); })) { ContinueRunAfterInterception(); } else { // There were interceptors to be run, so ContinueRunAfterInterception @@ -981,10 +981,8 @@ bool ServerInterface::BaseAsyncRequest::FinalizeResult(void** tag, interceptor_methods_.AddInterceptionHookPoint( experimental::InterceptionHookPoints::POST_RECV_INITIAL_METADATA); interceptor_methods_.SetRecvInitialMetadata(&context_->client_metadata_); - auto f = std::bind(&ServerInterface::BaseAsyncRequest:: - ContinueFinalizeResultAfterInterception, - this); - if (interceptor_methods_.RunInterceptors(f)) { + if (interceptor_methods_.RunInterceptors( + [this]() { ContinueFinalizeResultAfterInterception(); })) { // There are no interceptors to run. Continue } else { // There were interceptors to be run, so |