check already performed by MergeFrom

pull/3858/head
Jan Tattermusch 7 years ago
parent 0c874a6a19
commit 07542e78da
  1. 5
      csharp/src/Google.Protobuf/MessageParser.cs

@ -64,7 +64,6 @@ namespace Google.Protobuf
/// <returns>The newly parsed message.</returns>
public IMessage ParseFrom(byte[] data)
{
ProtoPreconditions.CheckNotNull(data, "data");
IMessage message = factory();
message.MergeFrom(data);
return message;
@ -79,7 +78,6 @@ namespace Google.Protobuf
/// <returns>The newly parsed message.</returns>
public IMessage ParseFrom(byte[] data, int offset, int length)
{
ProtoPreconditions.CheckNotNull(data, "data");
IMessage message = factory();
message.MergeFrom(data, offset, length);
return message;
@ -92,7 +90,6 @@ namespace Google.Protobuf
/// <returns>The parsed message.</returns>
public IMessage ParseFrom(ByteString data)
{
ProtoPreconditions.CheckNotNull(data, "data");
IMessage message = factory();
message.MergeFrom(data);
return message;
@ -206,7 +203,6 @@ namespace Google.Protobuf
/// <returns>The newly parsed message.</returns>
public new T ParseFrom(byte[] data)
{
ProtoPreconditions.CheckNotNull(data, "data");
T message = factory();
message.MergeFrom(data);
return message;
@ -219,7 +215,6 @@ namespace Google.Protobuf
/// <returns>The parsed message.</returns>
public new T ParseFrom(ByteString data)
{
ProtoPreconditions.CheckNotNull(data, "data");
T message = factory();
message.MergeFrom(data);
return message;

Loading…
Cancel
Save