aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/util/byte_buffer_proto_helper.cc
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2017-07-18 10:42:33 -0700
committerGravatar Vijay Pai <vpai@google.com>2017-07-18 11:07:43 -0700
commit0f95fa4909ba6f65364cb0b5c8c37a27c09b67b4 (patch)
treea98b582aa9e26d6aca4a3e23e8a4ab9dfe883ec3 /test/cpp/util/byte_buffer_proto_helper.cc
parentc39d4c16a02d49a1e4b090309786643045287639 (diff)
Add idiomatic C++ API for grpc::Slice construction that doesn't
require using grpc_slice
Diffstat (limited to 'test/cpp/util/byte_buffer_proto_helper.cc')
-rw-r--r--test/cpp/util/byte_buffer_proto_helper.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/test/cpp/util/byte_buffer_proto_helper.cc b/test/cpp/util/byte_buffer_proto_helper.cc
index 22dd074fe9..bb5162f86e 100644
--- a/test/cpp/util/byte_buffer_proto_helper.cc
+++ b/test/cpp/util/byte_buffer_proto_helper.cc
@@ -36,8 +36,7 @@ std::unique_ptr<ByteBuffer> SerializeToByteBuffer(
grpc::protobuf::Message* message) {
grpc::string buf;
message->SerializeToString(&buf);
- grpc_slice s = grpc_slice_from_copied_string(buf.c_str());
- Slice slice(s, Slice::STEAL_REF);
+ Slice slice(buf);
return std::unique_ptr<ByteBuffer>(new ByteBuffer(&slice, 1));
}