PR feetback
This commit is contained in:
parent
346d8eaa03
commit
ac5fd3f29f
|
|
@ -64,8 +64,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
private static int GetKnownMethodIndex(ulong value)
|
private static int GetKnownMethodIndex(ulong value)
|
||||||
{
|
{
|
||||||
const int MagicNumer = 0x0600000C;
|
const int magicNumer = 0x0600000C;
|
||||||
var tmp = (int)value & MagicNumer;
|
var tmp = (int)value & magicNumer;
|
||||||
|
|
||||||
return ((tmp >> 2) | (tmp >> 23)) & 0x0F;
|
return ((tmp >> 2) | (tmp >> 23)) & 0x0F;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,10 +76,7 @@ namespace Microsoft.AspNetCore.Server.KestrelTests
|
||||||
{
|
{
|
||||||
var data = new Span<byte>(methodData);
|
var data = new Span<byte>(methodData);
|
||||||
|
|
||||||
HttpMethod method;
|
var result = data.GetKnownMethod(out var method, out var length);
|
||||||
int length;
|
|
||||||
|
|
||||||
var result = data.GetKnownMethod(out method, out length);
|
|
||||||
|
|
||||||
Assert.Equal(expectedResult, result);
|
Assert.Equal(expectedResult, result);
|
||||||
Assert.Equal(expectedMethod, method);
|
Assert.Equal(expectedMethod, method);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue