Skip to content

Commit

Permalink
Use CompressionLevel.SmallestSize in Bundler (#80372)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub authored Jan 17, 2023
1 parent 116636d commit 0090de4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ private bool ShouldCompress(FileType type)

// We use DeflateStream here.
// It uses GZip algorithm, but with a trivial header that does not contain file info.
using (DeflateStream compressionStream = new DeflateStream(bundle, CompressionLevel.Optimal, leaveOpen: true))
CompressionLevel smallestSize = (CompressionLevel)3;
using (DeflateStream compressionStream = new DeflateStream(bundle, Enum.IsDefined(typeof(CompressionLevel), smallestSize) ? smallestSize : CompressionLevel.Optimal, leaveOpen: true))
{
file.CopyTo(compressionStream);
}
Expand Down

0 comments on commit 0090de4

Please sign in to comment.