コードインスペクション:冗長な 'orderby' 句 'ascending' キーワード
このインスペクションは、昇順がすでにデフォルトであるため、クエリの orderby 句内の ascending キーワードを報告します。 このキーワードを削除しても動作は変わらず、クエリが簡素化されます。
using System.Collections.Generic;
using System.Linq;
class C
{
IEnumerable<int> M(IEnumerable<int> values)
{
return from value in values
orderby value ascending
select value;
}
}
using System.Collections.Generic;
using System.Linq;
class C
{
IEnumerable<int> M(IEnumerable<int> values)
{
return from value in values
orderby value
select value;
}
}
2026 年 6 月 12 日