Skip to content

Commit

Permalink
Merge pull request dotnet/corertdotnet/coreclr#5109 from dotnet/nmirr…
Browse files Browse the repository at this point in the history
…or (dotnet/coreclr#15518)

Merge nmirror to master

Signed-off-by: dotnet-bot <[email protected]>

Commit migrated from dotnet/coreclr@d1c440a
  • Loading branch information
dotnet-bot authored and jkotas committed Dec 14, 2017
1 parent 9863c73 commit ab5deb5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/coreclr/src/mscorlib/shared/System/ReadOnlySpan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,18 @@ public bool IsEmpty
/// <exception cref="System.IndexOutOfRangeException">
/// Thrown when index less than 0 or index greater than or equal to Length
/// </exception>
public T this[int index]
{
#if PROJECTN
public ref readonly T this[int index]
{
[BoundsChecking]
get
{
return Unsafe.Add(ref _pointer.Value, index);
return ref Unsafe.Add(ref _pointer.Value, index);
}
}
#else
public T this[int index]
{
[Intrinsic]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[NonVersionable]
Expand All @@ -183,8 +186,8 @@ public T this[int index]
ThrowHelper.ThrowIndexOutOfRangeException();
return Unsafe.Add(ref _pointer.Value, index);
}
#endif
}
#endif

/// <summary>
/// Copies the contents of this read-only span into destination span. If the source
Expand Down

0 comments on commit ab5deb5

Please sign in to comment.