mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Use .Where for filtering
This commit is contained in:
parent
4b837d83bb
commit
7b1812af87
@ -1,4 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Wabbajack.Common.IO;
|
||||
|
||||
namespace Wabbajack.Common
|
||||
@ -63,14 +64,13 @@ namespace Wabbajack.Common
|
||||
var driveInfo = folder.DriveInfo().DiskSpaceInfo;
|
||||
var clusterSize = driveInfo.SectorsPerCluster * driveInfo.BytesPerSector;
|
||||
|
||||
await folder.EnumerateFiles(true)
|
||||
await folder
|
||||
.EnumerateFiles(true)
|
||||
.Where(f => f.Size > clusterSize)
|
||||
.PMap(queue, async path =>
|
||||
{
|
||||
if (path.Size > clusterSize)
|
||||
{
|
||||
Utils.Status($"Compacting {path.FileName}");
|
||||
await path.Compact(algorithm);
|
||||
}
|
||||
Utils.Status($"Compacting {path.FileName}");
|
||||
await path.Compact(algorithm);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user