Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Commit 56a5cd1

Browse files
author
Cesar Blum Silveira
committed
Don't try to optimize method and version string allocations on big endian.
1 parent b0090a1 commit 56a5cd1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Microsoft.AspNet.Server.Kestrel/Infrastructure/MemoryPoolIterator2Extensions.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,13 @@ public static ArraySegment<byte> GetArraySegment(this MemoryPoolIterator2 start,
280280
public static bool GetKnownString(this MemoryPoolIterator2 begin, MemoryPoolIterator2 end, out string knownString)
281281
{
282282
knownString = null;
283+
284+
// This optimization only works on little endian environments (for now).
285+
if (!BitConverter.IsLittleEndian)
286+
{
287+
return false;
288+
}
289+
283290
var inputLength = begin.GetLength(end);
284291

285292
if (inputLength > sizeof(long))

0 commit comments

Comments
 (0)