From 21177671b6cd4252c5f0b11c2ba5eec6e2f55419 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 7 Feb 2019 15:31:33 -0800 Subject: [PATCH] Remove extraneous call to GetMemory in BufferWriter (#7354) The BufferWriter called GetMemory(count) and dropped the result, only to then call GetSpan(). This moves the count argument to GetSpan, and drops the call to GetMemory. --- src/Servers/Kestrel/Core/src/Internal/BufferWriter.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Servers/Kestrel/Core/src/Internal/BufferWriter.cs b/src/Servers/Kestrel/Core/src/Internal/BufferWriter.cs index 1f33f3e4cb..6d59d461be 100644 --- a/src/Servers/Kestrel/Core/src/Internal/BufferWriter.cs +++ b/src/Servers/Kestrel/Core/src/Internal/BufferWriter.cs @@ -73,8 +73,7 @@ namespace System.Buffers Commit(); } - _output.GetMemory(count); - _span = _output.GetSpan(); + _span = _output.GetSpan(count); } private void WriteMultiBuffer(ReadOnlySpan source)