Skip to content

Commit bedb657

Browse files
kireadminCopilot
andcommitted
Improve recursive path enumeration performance
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent f6cecef commit bedb657

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎Engine/ScriptAnalyzer.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,18 +1777,18 @@ private void BuildScriptPathList(
17771777
{
17781778
if (searchRecursively)
17791779
{
1780-
foreach (string filePath in Directory.GetFiles(path))
1780+
foreach (string filePath in Directory.EnumerateFiles(path))
17811781
{
17821782
this.BuildScriptPathList(filePath, searchRecursively, scriptFilePaths);
17831783
}
1784-
foreach (string filePath in Directory.GetDirectories(path))
1784+
foreach (string filePath in Directory.EnumerateDirectories(path))
17851785
{
17861786
this.BuildScriptPathList(filePath, searchRecursively, scriptFilePaths);
17871787
}
17881788
}
17891789
else
17901790
{
1791-
foreach (string filePath in Directory.GetFiles(path))
1791+
foreach (string filePath in Directory.EnumerateFiles(path))
17921792
{
17931793
this.BuildScriptPathList(filePath, searchRecursively, scriptFilePaths);
17941794
}

0 commit comments

Comments
 (0)