Small cleanup (#29125)

The std::moves of temporaries prevented copy elision, and the functions
were unused (one with a TODO to re-enable later)
pull/29128/head
AJ Heller 3 years ago committed by GitHub
parent 01f333a1c1
commit 1f03bbab39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      examples/cpp/route_guide/route_guide_callback_client.cc
  2. 6
      test/cpp/end2end/channelz_service_test.cc

@ -138,7 +138,7 @@ class RouteGuideClient {
bool done_ = false;
};
Reader reader(stub_.get(), kCoordFactor_, rect);
Status status = std::move(reader.Await());
Status status = reader.Await();
if (status.ok()) {
std::cout << "ListFeatures rpc succeeded." << std::endl;
} else {
@ -217,7 +217,7 @@ class RouteGuideClient {
};
Recorder recorder(stub_.get(), kCoordFactor_, &feature_list_);
RouteSummary stats;
Status status = std::move(recorder.Await(&stats));
Status status = recorder.Await(&stats);
if (status.ok()) {
std::cout << "Finished trip with " << stats.point_count() << " points\n"
<< "Passed " << stats.feature_count() << " features\n"
@ -288,7 +288,7 @@ class RouteGuideClient {
};
Chatter chatter(stub_.get());
Status status = std::move(chatter.Await());
Status status = chatter.Await();
if (!status.ok()) {
std::cout << "RouteChat rpc failed." << std::endl;
}

@ -139,12 +139,6 @@ std::string ReadFile(const char* file_path) {
return file_contents;
}
grpc_core::PemKeyCertPairList ReadTlsIdentityPair(const char* key_path,
const char* cert_path) {
return grpc_core::PemKeyCertPairList{
grpc_core::PemKeyCertPair(ReadFile(key_path), ReadFile(cert_path))};
}
std::shared_ptr<grpc::ChannelCredentials> GetChannelCredentials(
CredentialsType type, ChannelArguments* args) {
if (type == CredentialsType::kInsecure) {

Loading…
Cancel
Save