mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Enable CA1860: Avoid using 'Enumerable.Any()' extension method (#26109)
This commit is contained in:
@@ -514,6 +514,10 @@ dotnet_diagnostic.CA1847.severity = warning
|
||||
# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1858
|
||||
dotnet_diagnostic.CA1858.severity = warning
|
||||
|
||||
# CA1860: Avoid using 'Enumerable.Any()' extension method
|
||||
# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1860
|
||||
dotnet_diagnostic.CA1860.severity = warning
|
||||
|
||||
# CA1868: Unnecessary call to 'Contains' for sets
|
||||
# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1868
|
||||
dotnet_diagnostic.CA1868.severity = warning
|
||||
|
||||
@@ -1611,7 +1611,7 @@ namespace System.Management.Automation
|
||||
bool needToReAddInstanceMembersAndTypeNames = !object.ReferenceEquals(GetKeyForResurrectionTables(this), GetKeyForResurrectionTables(returnValue));
|
||||
if (needToReAddInstanceMembersAndTypeNames)
|
||||
{
|
||||
Diagnostics.Assert(!returnValue.InstanceMembers.Any(), "needToReAddInstanceMembersAndTypeNames should mean that the new object has a fresh/empty list of instance members");
|
||||
Diagnostics.Assert(returnValue.InstanceMembers.Count == 0, "needToReAddInstanceMembersAndTypeNames should mean that the new object has a fresh/empty list of instance members");
|
||||
foreach (PSMemberInfo member in this.InstanceMembers)
|
||||
{
|
||||
if (member.IsHidden)
|
||||
|
||||
Reference in New Issue
Block a user