Update use of AsBytes in perf tests to use MemoryMarshal.AsBytes. (#17214)
authorAhson Khan <ahkha@microsoft.com>
Mon, 26 Mar 2018 00:26:12 +0000 (17:26 -0700)
committerGitHub <noreply@github.com>
Mon, 26 Mar 2018 00:26:12 +0000 (17:26 -0700)
tests/src/JIT/Performance/CodeQuality/Span/SpanBench.cs

index 10bb4c5..3acedaf 100644 (file)
@@ -960,7 +960,7 @@ namespace Span
 
             for (int i = 0; i < iterationCount; i++)
             {
-                var byteSpan = span.AsBytes();
+                var byteSpan = MemoryMarshal.AsBytes(span);
                 // Under a condition that we know is false but the jit doesn't,
                 // add a read from 'byteSpan' to make sure it's not dead, and an assignment
                 // to 'span' so the AsBytes call won't get hoisted.