From 2c98fe011902108194095a493193171fbebb31b0 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Mon, 17 Oct 2022 12:43:12 -0700 Subject: [PATCH] SerializationTraits: Remove unnecessary 2nd template parameter (#31363) --- include/grpcpp/impl/codegen/call_op_set.h | 8 ++------ test/cpp/util/byte_buffer_test.cc | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/include/grpcpp/impl/codegen/call_op_set.h b/include/grpcpp/impl/codegen/call_op_set.h index f624108e12c..b1d28460985 100644 --- a/include/grpcpp/impl/codegen/call_op_set.h +++ b/include/grpcpp/impl/codegen/call_op_set.h @@ -384,11 +384,7 @@ Status CallOpSendMessage::SendMessage(const M& message, WriteOptions options) { write_options_ = options; // Serialize immediately since we do not have access to the message pointer bool own_buf; - // TODO(vjpai): Remove the void below when possible - // The void in the template parameter below should not be needed - // (since it should be implicit) but is needed due to an observed - // difference in behavior between clang and gcc for certain internal users - Status result = SerializationTraits::Serialize( + Status result = SerializationTraits::Serialize( message, send_buf_.bbuf_ptr(), &own_buf); if (!own_buf) { send_buf_.Duplicate(); @@ -413,7 +409,7 @@ Status CallOpSendMessage::SendMessagePtr(const M* message, // The void in the template parameter below should not be needed // (since it should be implicit) but is needed due to an observed // difference in behavior between clang and gcc for certain internal users - Status result = SerializationTraits::Serialize( + Status result = SerializationTraits::Serialize( *static_cast(message), send_buf_.bbuf_ptr(), &own_buf); if (!own_buf) { send_buf_.Duplicate(); diff --git a/test/cpp/util/byte_buffer_test.cc b/test/cpp/util/byte_buffer_test.cc index b06af1ecf61..7a07635b1dd 100644 --- a/test/cpp/util/byte_buffer_test.cc +++ b/test/cpp/util/byte_buffer_test.cc @@ -116,8 +116,8 @@ TEST_F(ByteBufferTest, SerializationMakesCopy) { bool owned = false; ByteBuffer buffer(&slices[0], 2); slices.clear(); - auto status = SerializationTraits::Serialize( - buffer, &send_buffer, &owned); + auto status = + SerializationTraits::Serialize(buffer, &send_buffer, &owned); EXPECT_TRUE(status.ok()); EXPECT_TRUE(owned); EXPECT_TRUE(send_buffer.Valid());