Skip to content

Commit

Permalink
Switched FindFiles() public static method of the FileManager class to…
Browse files Browse the repository at this point in the history
… EnumerateFiles() use.
  • Loading branch information
xvitaly committed Sep 4, 2024
1 parent 7c5c4ef commit 98965d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/corelib/FileManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,10 @@ public static List<string> FindFiles(string SearchPath, string SrcMask, bool IsR
List<string> Result = new List<string>();
if (Directory.Exists(SearchPath))
{
DirectoryInfo DInfo = new DirectoryInfo(SearchPath);
FileInfo[] DirList = DInfo.GetFiles(SrcMask);
foreach (FileInfo DItem in DirList) { Result.Add(DItem.FullName); }
if (IsRecursive) { foreach (DirectoryInfo Dir in DInfo.GetDirectories()) { Result.AddRange(FindFiles(Dir.FullName, SrcMask)); } }
foreach (string DItem in Directory.EnumerateFiles(SearchPath, SrcMask, IsRecursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly))
{
Result.Add(DItem);
}
}
return Result;
}
Expand Down

0 comments on commit 98965d3

Please sign in to comment.