Skip to content

Commit

Permalink
WriteAll: use delegate instead of Expression
Browse files Browse the repository at this point in the history
  • Loading branch information
OwnageIsMagic committed Jul 18, 2022
1 parent c73a8cb commit 2946a35
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/SharpCompress/Writers/IWriterExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void WriteAll(this IWriter writer, string directory, string search
public static void WriteAll(this IWriter writer,
string directory,
string searchPattern = "*",
Expression<Func<string, bool>>? fileSearchFunc = null,
Func<string, bool>? fileSearchFunc = null,
SearchOption option = SearchOption.TopDirectoryOnly)
{
if (!Directory.Exists(directory))
Expand All @@ -49,10 +49,10 @@ public static void WriteAll(this IWriter writer, string directory, string search
{
fileSearchFunc = n => true;
}
foreach (var file in Directory.EnumerateFiles(directory, searchPattern, option).Where(fileSearchFunc.Compile()))
foreach (var file in Directory.EnumerateFiles(directory, searchPattern, option).Where(fileSearchFunc))
{
writer.Write(file.Substring(directory.Length), file);
}
}
}
}
}

0 comments on commit 2946a35

Please sign in to comment.