From 0f95fa4909ba6f65364cb0b5c8c37a27c09b67b4 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Tue, 18 Jul 2017 10:42:33 -0700 Subject: Add idiomatic C++ API for grpc::Slice construction that doesn't require using grpc_slice --- test/cpp/util/byte_buffer_proto_helper.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/cpp/util/byte_buffer_proto_helper.cc') 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 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(new ByteBuffer(&slice, 1)); } -- cgit v1.2.3