ReadOnlySpan goodness (#8392)

This commit is contained in:
Ben Adams 2019-03-12 05:28:20 +00:00 committed by David Fowler
parent 77948feeba
commit a95c4b6fd0
2 changed files with 3 additions and 3 deletions

View File

@ -14,8 +14,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
public sealed partial class HttpResponseHeaders : HttpHeaders
{
private static readonly byte[] _CrLf = new[] { (byte)'\r', (byte)'\n' };
private static readonly byte[] _colonSpace = new[] { (byte)':', (byte)' ' };
private static ReadOnlySpan<byte> _CrLf => new[] { (byte)'\r', (byte)'\n' };
private static ReadOnlySpan<byte> _colonSpace => new[] { (byte)':', (byte)' ' };
public Enumerator GetEnumerator()
{

View File

@ -21,7 +21,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
public class Http2FrameWriter
{
// Literal Header Field without Indexing - Indexed Name (Index 8 - :status)
private static readonly byte[] _continueBytes = new byte[] { 0x08, 0x03, (byte)'1', (byte)'0', (byte)'0' };
private static ReadOnlySpan<byte> _continueBytes => new byte[] { 0x08, 0x03, (byte)'1', (byte)'0', (byte)'0' };
private readonly object _writeLock = new object();
private readonly Http2Frame _outgoingFrame;