address comments

pull/18865/head
Jan Tattermusch 6 years ago
parent 8a5b803fef
commit d69128bf07
  1. 7
      src/csharp/Grpc.Core/Internal/DefaultDeserializationContext.cs

@ -82,14 +82,11 @@ namespace Grpc.Core.Internal
return instance;
}
#if GRPC_CSHARP_SUPPORT_SYSTEM_MEMORY
private void FillContinguousBuffer(IBufferReader reader, byte[] destination)
{
#if GRPC_CSHARP_SUPPORT_SYSTEM_MEMORY
PayloadAsReadOnlySequence().CopyTo(new Span<byte>(destination));
}
#else
private void FillContinguousBuffer(IBufferReader reader, byte[] destination)
{
int offset = 0;
while (reader.TryGetNextSlice(out Slice slice))
{
@ -98,7 +95,7 @@ namespace Grpc.Core.Internal
}
// check that we filled the entire destination
GrpcPreconditions.CheckState(offset == payloadLength);
}
#endif
}
}
}

Loading…
Cancel
Save