From d0d007e6d1139625e05ebd5859289c08a8668033 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Wed, 18 Feb 2015 10:28:09 -0800 Subject: [PATCH] change metadata getters to return const& --- include/grpc++/client_context.h | 4 ++-- include/grpc++/server_context.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/grpc++/client_context.h b/include/grpc++/client_context.h index 7f1069ea5ee..8345a6f5aff 100644 --- a/include/grpc++/client_context.h +++ b/include/grpc++/client_context.h @@ -81,12 +81,12 @@ class ClientContext { void AddMetadata(const grpc::string &meta_key, const grpc::string &meta_value); - std::multimap GetServerInitialMetadata() { + const std::multimap& GetServerInitialMetadata() { GPR_ASSERT(initial_metadata_received_); return recv_initial_metadata_; } - std::multimap GetServerTrailingMetadata() { + const std::multimap& GetServerTrailingMetadata() { // TODO(yangg) check finished return trailing_metadata_; } diff --git a/include/grpc++/server_context.h b/include/grpc++/server_context.h index 853f91f4671..3a7b693f9a9 100644 --- a/include/grpc++/server_context.h +++ b/include/grpc++/server_context.h @@ -76,7 +76,7 @@ class ServerContext final { void AddInitialMetadata(const grpc::string& key, const grpc::string& value); void AddTrailingMetadata(const grpc::string& key, const grpc::string& value); - std::multimap client_metadata() { + const std::multimap& client_metadata() { return client_metadata_; }