未验证 提交 1e2485f0 编写于 作者: X xtqqczze 提交者: GitHub

Remove `IsEmpty` workaround in `Span` and `ReadOnlySpan` (#66865)

* Revert "Workaround to remove unnecessary bounds checks when using {ReadOnly}Span.IsEmpty (dotnet/coreclr#19640)"

This reverts commit 82bd67f7.

* Update doc comments

* Apply suggestions from code review
Co-authored-by: NRobin Lindner <robin.lindner1@t-online.de>

* Apply suggestions from code review
Co-authored-by: NRobin Lindner <robin@deeprobin.de>
Co-authored-by: NAaron Robinson <arobins@microsoft.com>
Co-authored-by: NRobin Lindner <robin.lindner1@t-online.de>
Co-authored-by: NRobin Lindner <robin@deeprobin.de>
上级 d96073ad
......@@ -147,12 +147,13 @@ public int Length
}
/// <summary>
/// Returns true if Length is 0.
/// Gets a value indicating whether this <see cref="ReadOnlySpan{T}"/> is empty.
/// </summary>
/// <value><see langword="true"/> if this span is empty; otherwise, <see langword="false"/>.</value>
public bool IsEmpty
{
[NonVersionable]
get => 0 >= (uint)_length; // Workaround for https://github.com/dotnet/runtime/issues/10950
get => _length == 0;
}
/// <summary>
......
......@@ -152,12 +152,13 @@ public int Length
}
/// <summary>
/// Returns true if Length is 0.
/// Gets a value indicating whether this <see cref="Span{T}"/> is empty.
/// </summary>
/// <value><see langword="true"/> if this span is empty; otherwise, <see langword="false"/>.</value>
public bool IsEmpty
{
[NonVersionable]
get => 0 >= (uint)_length; // Workaround for https://github.com/dotnet/runtime/issues/10950
get => _length == 0;
}
/// <summary>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册