diff --git a/Engine/ScriptAnalyzer.cs b/Engine/ScriptAnalyzer.cs index adc81f2d3..91bf188f2 100644 --- a/Engine/ScriptAnalyzer.cs +++ b/Engine/ScriptAnalyzer.cs @@ -1777,18 +1777,18 @@ private void BuildScriptPathList( { if (searchRecursively) { - foreach (string filePath in Directory.GetFiles(path)) + foreach (string filePath in Directory.EnumerateFiles(path)) { this.BuildScriptPathList(filePath, searchRecursively, scriptFilePaths); } - foreach (string filePath in Directory.GetDirectories(path)) + foreach (string filePath in Directory.EnumerateDirectories(path)) { this.BuildScriptPathList(filePath, searchRecursively, scriptFilePaths); } } else { - foreach (string filePath in Directory.GetFiles(path)) + foreach (string filePath in Directory.EnumerateFiles(path)) { this.BuildScriptPathList(filePath, searchRecursively, scriptFilePaths); }