Skip to content

Commit

Permalink
Refactored directory existence check in DetectFilesForCleanup() metho…
Browse files Browse the repository at this point in the history
…d of the FrmCleaner class.
  • Loading branch information
xvitaly committed Sep 4, 2024
1 parent f24419e commit c57d844
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/srcrepair/FrmCleaner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,11 @@ private void DetectFilesForCleanup(List<string> Targets, bool Recursive)
{
string CleanDir = Path.GetDirectoryName(DirMs);
string CleanMask = Path.GetFileName(DirMs);

if (!Directory.Exists(CleanDir))
{
Logger.Warn(DebugStrings.AppDbgExClnDirectoryDoesNotExist, CleanDir);
continue;
}

try
{
DirectoryInfo DInfo = new DirectoryInfo(CleanDir);
if (!DInfo.Exists) { continue; }
foreach (FileInfo DItem in DInfo.EnumerateFiles(CleanMask, Recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly))
{
ListViewItem LvItem = new ListViewItem(DItem.Name)
Expand Down

0 comments on commit c57d844

Please sign in to comment.