Skip to content

Commit

Permalink
Files are no longer unnecessarily loaded into memory with AsParallel
Browse files Browse the repository at this point in the history
  • Loading branch information
josepho0918 committed Jun 11, 2024
1 parent ba46eaf commit 0d25a37
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion TrimTail/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public static void ProcessDir(string dirPath, HashSet<string> allowedExts)
Console.WriteLine($"Processing directory: {dirPath}");

var files = Directory.EnumerateFiles(dirPath, "*", SearchOption.AllDirectories)
.AsParallel()
.Where(filePath => allowedExts.Contains(Path.GetExtension(filePath).ToLowerInvariant()));

Parallel.ForEach(files, filePath =>
Expand Down

0 comments on commit 0d25a37

Please sign in to comment.