Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jtattermusch committed May 7, 2019
1 parent 8a5b803 commit d69128b
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,11 @@ public static DefaultDeserializationContext GetInitializedThreadLocal(IBufferRea
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))
{
Expand All @@ -98,7 +95,7 @@ private void FillContinguousBuffer(IBufferReader reader, byte[] destination)
}
// check that we filled the entire destination
GrpcPreconditions.CheckState(offset == payloadLength);
}
#endif
}
}
}

0 comments on commit d69128b

Please sign in to comment.