diff options
author | Yang Gao <yangg@google.com> | 2015-02-18 10:28:09 -0800 |
---|---|---|
committer | Yang Gao <yangg@google.com> | 2015-02-18 10:28:09 -0800 |
commit | d0d007e6d1139625e05ebd5859289c08a8668033 (patch) | |
tree | af20c0976b2f4337be8d3d04f008e4598e381b6b | |
parent | 3c665f56be5e480e070a28674b62beea2fe515e9 (diff) |
change metadata getters to return const&
-rw-r--r-- | include/grpc++/client_context.h | 4 | ||||
-rw-r--r-- | 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 7f1069ea5e..8345a6f5af 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<grpc::string, grpc::string> GetServerInitialMetadata() { + const std::multimap<grpc::string, grpc::string>& GetServerInitialMetadata() { GPR_ASSERT(initial_metadata_received_); return recv_initial_metadata_; } - std::multimap<grpc::string, grpc::string> GetServerTrailingMetadata() { + const std::multimap<grpc::string, grpc::string>& GetServerTrailingMetadata() { // TODO(yangg) check finished return trailing_metadata_; } diff --git a/include/grpc++/server_context.h b/include/grpc++/server_context.h index 853f91f467..3a7b693f9a 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<grpc::string, grpc::string> client_metadata() { + const std::multimap<grpc::string, grpc::string>& client_metadata() { return client_metadata_; } |