REFACTOR: Loop can be converted into LINQ-expression.

This commit is contained in:
2017-12-21 07:08:26 +00:00
parent 4d886dae25
commit 5592f147ac
71 changed files with 668 additions and 1131 deletions

View File

@@ -33,6 +33,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using DiscImageChef.Console;
using DiscImageChef.Core;
@@ -156,9 +157,7 @@ namespace DiscImageChef.Commands
}
string[] contents = Directory.GetFiles(options.InputFile, "*", SearchOption.TopDirectoryOnly);
List<string> files = new List<string>();
foreach(string file in contents) if(new FileInfo(file).Length % options.BlockSize == 0) files.Add(file);
List<string> files = contents.Where(file => new FileInfo(file).Length % options.BlockSize == 0).ToList();
files.Sort(StringComparer.CurrentCultureIgnoreCase);