Use List.ConvertAll instead of LINQ (#15140)

This commit is contained in:
xtqqczze 2021-04-27 22:17:12 +01:00 committed by GitHub
parent 08e731398c
commit 59715d5ba9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Management.Automation;
using System.Management.Automation.Remoting;
using System.Management.Automation.Runspaces;
@ -85,7 +84,7 @@ namespace Microsoft.PowerShell.Commands
// first type group will take effect. So we skip the rest groups that have the same name.
if (!typeGroupMap.ContainsKey(typeGroup.name))
{
var typesInGroup = typeGroup.typeReferenceList.Select(static typeReference => typeReference.name).ToList();
var typesInGroup = typeGroup.typeReferenceList.ConvertAll(static typeReference => typeReference.name);
typeGroupMap.Add(typeGroup.name, typesInGroup);
}
}