Skip to content

Commit a95c4b6

Browse files
benaadamsdavidfowl
authored andcommitted
ReadOnlySpan goodness (#8392)
1 parent 77948fe commit a95c4b6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseHeaders.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
1414
{
1515
public sealed partial class HttpResponseHeaders : HttpHeaders
1616
{
17-
private static readonly byte[] _CrLf = new[] { (byte)'\r', (byte)'\n' };
18-
private static readonly byte[] _colonSpace = new[] { (byte)':', (byte)' ' };
17+
private static ReadOnlySpan<byte> _CrLf => new[] { (byte)'\r', (byte)'\n' };
18+
private static ReadOnlySpan<byte> _colonSpace => new[] { (byte)':', (byte)' ' };
1919

2020
public Enumerator GetEnumerator()
2121
{

src/Servers/Kestrel/Core/src/Internal/Http2/Http2FrameWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
2121
public class Http2FrameWriter
2222
{
2323
// Literal Header Field without Indexing - Indexed Name (Index 8 - :status)
24-
private static readonly byte[] _continueBytes = new byte[] { 0x08, 0x03, (byte)'1', (byte)'0', (byte)'0' };
24+
private static ReadOnlySpan<byte> _continueBytes => new byte[] { 0x08, 0x03, (byte)'1', (byte)'0', (byte)'0' };
2525

2626
private readonly object _writeLock = new object();
2727
private readonly Http2Frame _outgoingFrame;

0 commit comments

Comments
 (0)