Devirtualize HttpHeaders.Reset (#5950)

* Use Inlining to devirtualize
This commit is contained in:
Ben Adams 2019-01-11 05:34:41 +01:00 committed by David Fowler
parent 14e606997f
commit 31c8423df1
3 changed files with 4 additions and 2 deletions

View File

@ -111,6 +111,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
_isReadOnly = true;
}
// Inline to allow ClearFast to devirtualize in caller
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Reset()
{
_isReadOnly = false;

View File

@ -11,7 +11,7 @@ using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
public partial class HttpRequestHeaders : HttpHeaders
public sealed partial class HttpRequestHeaders : HttpHeaders
{
private static long ParseContentLength(string value)
{

View File

@ -12,7 +12,7 @@ using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
public partial class HttpResponseHeaders : HttpHeaders
public sealed partial class HttpResponseHeaders : HttpHeaders
{
private static readonly byte[] _CrLf = new[] { (byte)'\r', (byte)'\n' };
private static readonly byte[] _colonSpace = new[] { (byte)':', (byte)' ' };