mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Avoid array allocations from GetDirectories/GetFiles. (#14328)
This commit is contained in:
1 parent
09cc338789
commit
86ca45681d
1 file changed
+1
-1
@@ -6096,7 +6096,7 @@ namespace System.Management.Automation
|
||||
|
||||
foreach (var dir in searchPaths)
|
||||
{
|
||||
foreach (var file in Directory.GetFiles(dir))
|
||||
foreach (var file in Directory.EnumerateFiles(dir))
|
||||
{
|
||||
if (wildcardPattern.IsMatch(Path.GetFileName(file)))
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user