summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework/Compression
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-06 18:24:59 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-06 18:24:59 -0400
commita593eda30f82af474887d91458b0e9158f66fefc (patch)
tree8aa0e0586e3cce7627e8c4ff445a953665953f8f /src/SMAPI.Web/Framework/Compression
parent29f909a8d5dbb83d6df1a54d2680e6f9898f3b19 (diff)
downloadSMAPI-a593eda30f82af474887d91458b0e9158f66fefc.tar.gz
SMAPI-a593eda30f82af474887d91458b0e9158f66fefc.tar.bz2
SMAPI-a593eda30f82af474887d91458b0e9158f66fefc.zip
use target-typed new
Diffstat (limited to 'src/SMAPI.Web/Framework/Compression')
-rw-r--r--src/SMAPI.Web/Framework/Compression/GzipHelper.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/SMAPI.Web/Framework/Compression/GzipHelper.cs b/src/SMAPI.Web/Framework/Compression/GzipHelper.cs
index 676d660d..93cde9d3 100644
--- a/src/SMAPI.Web/Framework/Compression/GzipHelper.cs
+++ b/src/SMAPI.Web/Framework/Compression/GzipHelper.cs
@@ -29,9 +29,9 @@ namespace StardewModdingAPI.Web.Framework.Compression
// compressed
byte[] compressedData;
- using (MemoryStream stream = new MemoryStream())
+ using (MemoryStream stream = new())
{
- using (GZipStream zipStream = new GZipStream(stream, CompressionLevel.Optimal, leaveOpen: true))
+ using (GZipStream zipStream = new(stream, CompressionLevel.Optimal, leaveOpen: true))
zipStream.Write(buffer, 0, buffer.Length);
stream.Position = 0;
@@ -69,7 +69,7 @@ namespace StardewModdingAPI.Web.Framework.Compression
return rawText;
// decompress
- using MemoryStream memoryStream = new MemoryStream();
+ using MemoryStream memoryStream = new();
{
// read length prefix
int dataLength = BitConverter.ToInt32(zipBuffer, 0);
@@ -78,7 +78,7 @@ namespace StardewModdingAPI.Web.Framework.Compression
// read data
byte[] buffer = new byte[dataLength];
memoryStream.Position = 0;
- using (GZipStream gZipStream = new GZipStream(memoryStream, CompressionMode.Decompress))
+ using (GZipStream gZipStream = new(memoryStream, CompressionMode.Decompress))
gZipStream.Read(buffer, 0, buffer.Length);
// return original string