Skip to content

Commit

Permalink
Unify naming
Browse files Browse the repository at this point in the history
  • Loading branch information
josepho0918 committed May 30, 2024
1 parent fb88e2e commit 8ec1adc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ private static void RemoveTrailingBlanks(in string file_path)
File.Replace(temp_path, file_path, null);
}

private static void ProcessDir(string directoryPath, HashSet<string> allowed_exts)
private static void ProcessDir(string dir_path, HashSet<string> allowed_exts)
{
Console.WriteLine($"Processing directory: {directoryPath}");
Console.WriteLine($"Processing directory: {dir_path}");

var files = Directory.EnumerateFiles(directoryPath, "*", SearchOption.AllDirectories)
var files = Directory.EnumerateFiles(dir_path, "*", SearchOption.AllDirectories)
.AsParallel()
.Where(file_path => allowed_exts.Contains(Path.GetExtension(file_path).ToLower()));

Parallel.ForEach(files, file_path =>
{
RemoveTrailingBlanks(file_path);
sem.Wait();
Console.WriteLine(Path.GetRelativePath(directoryPath, file_path));
Console.WriteLine(Path.GetRelativePath(dir_path, file_path));
sem.Release();
});
}
Expand Down

0 comments on commit 8ec1adc

Please sign in to comment.