Skip to content

Commit 31c8423

Browse files
benaadamsdavidfowl
authored andcommitted
Devirtualize HttpHeaders.Reset (#5950)
* Use Inlining to devirtualize
1 parent 14e6069 commit 31c8423

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ public void SetReadOnly()
111111
_isReadOnly = true;
112112
}
113113

114+
// Inline to allow ClearFast to devirtualize in caller
115+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
114116
public void Reset()
115117
{
116118
_isReadOnly = false;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
1313
{
14-
public partial class HttpRequestHeaders : HttpHeaders
14+
public sealed partial class HttpRequestHeaders : HttpHeaders
1515
{
1616
private static long ParseContentLength(string value)
1717
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
1414
{
15-
public partial class HttpResponseHeaders : HttpHeaders
15+
public sealed partial class HttpResponseHeaders : HttpHeaders
1616
{
1717
private static readonly byte[] _CrLf = new[] { (byte)'\r', (byte)'\n' };
1818
private static readonly byte[] _colonSpace = new[] { (byte)':', (byte)' ' };

0 commit comments

Comments
 (0)