mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Loop can be converted into LINQ-expression.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user