From f2b83a8abc918922df0338cef2d392dac9b2b0a5 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Wed, 21 Feb 2018 21:41:44 -0800 Subject: [PATCH] Rename AsReadOnlySpan -> Span --- tests/src/JIT/Performance/CodeQuality/Span/SpanBench.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/src/JIT/Performance/CodeQuality/Span/SpanBench.cs b/tests/src/JIT/Performance/CodeQuality/Span/SpanBench.cs index 99f5517..10bb4c5 100644 --- a/tests/src/JIT/Performance/CodeQuality/Span/SpanBench.cs +++ b/tests/src/JIT/Performance/CodeQuality/Span/SpanBench.cs @@ -1013,11 +1013,11 @@ namespace Span } #endregion - #region TestSpanAsReadOnlySpanStringChar + #region TestSpanAsSpanStringChar [Benchmark(InnerIterationCount = BaseIterations)] [InlineData(100)] - public static void TestSpanAsReadOnlySpanStringCharWrapper(int length) + public static void TestSpanAsSpanStringCharWrapper(int length) { StringBuilder sb = new StringBuilder(); Random rand = new Random(42); @@ -1029,22 +1029,22 @@ namespace Span } string s = sb.ToString(); - Invoke((int innerIterationCount) => TestSpanAsReadOnlySpanStringChar(s, innerIterationCount, false), - "TestSpanAsReadOnlySpanStringChar({0})", length); + Invoke((int innerIterationCount) => TestSpanAsSpanStringChar(s, innerIterationCount, false), + "TestSpanAsSpanStringChar({0})", length); } [MethodImpl(MethodImplOptions.NoInlining)] - static void TestSpanAsReadOnlySpanStringChar(string s, int iterationCount, bool untrue) + static void TestSpanAsSpanStringChar(string s, int iterationCount, bool untrue) { var sink = Sink.Instance; for (int i = 0; i < iterationCount; i++) { - var charSpan = s.AsReadOnlySpan(); + var charSpan = s.AsSpan(); // Under a condition that we know is false but the jit doesn't, // add a read from 'charSpan' to make sure it's not dead, and an assignment // to 's' so the AsBytes call won't get hoisted. - if (untrue) { sink.Data = charSpan[0]; s = "block hoisting the call to AsReadOnlySpan()"; } + if (untrue) { sink.Data = charSpan[0]; s = "block hoisting the call to AsSpan()"; } } } -- 2.7.4