for (int i = 0; i < iterationCount; i++)
{
- var charSpan = s.AsSpan();
+ var charSpan = s.AsReadOnlySpan();
// 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 AsSpan()"; }
+ if (untrue) { sink.Data = charSpan[0]; s = "block hoisting the call to AsReadOnlySpan()"; }
}
}
<Version>4.4.0-beta-24913-02</Version>
</PackageReference>
<PackageReference Include="System.Memory">
- <Version>4.4.0-preview2-25302-03</Version>
+ <Version>4.5.0-preview2-25504-02</Version>
</PackageReference>
<PackageReference Include="System.Numerics.Vectors">
<Version>4.4.0-preview2-25302-03</Version>