From d69128bf078dd078fdb91ec239a33810203b0043 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 7 May 2019 05:38:56 -0400 Subject: [PATCH] address comments --- .../Grpc.Core/Internal/DefaultDeserializationContext.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/csharp/Grpc.Core/Internal/DefaultDeserializationContext.cs b/src/csharp/Grpc.Core/Internal/DefaultDeserializationContext.cs index bac7bbe4c59..946c37de190 100644 --- a/src/csharp/Grpc.Core/Internal/DefaultDeserializationContext.cs +++ b/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(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 + } } }