Skip to content

Commit

Permalink
Merge pull request #683 from OwnageIsMagic/patch-1
Browse files Browse the repository at this point in the history
WriteAll: use delegate instead of Expression
  • Loading branch information
adamhathcock authored Jul 27, 2022
2 parents deddf12 + 6476425 commit c1110f2
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,
{
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 c1110f2

Please sign in to comment.