From 14bce6952115248628f8f7d83adc62fef645fa84 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 27 Jan 2020 22:31:09 +0100 Subject: [PATCH] this has been bugging me for a while --- MLEM.Data/NetExtensions.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MLEM.Data/NetExtensions.cs b/MLEM.Data/NetExtensions.cs index 6b9fc1f..e7b0edc 100644 --- a/MLEM.Data/NetExtensions.cs +++ b/MLEM.Data/NetExtensions.cs @@ -42,8 +42,8 @@ namespace MLEM.Data { return; } using (var memory = new MemoryStream()) { - using (var gzip = new DeflateStream(memory, CompressionLevel.Fastest, true)) - serializer.Serialize(new BsonDataWriter(gzip), obj, typeof(T)); + using (var stream = new DeflateStream(memory, CompressionLevel.Fastest, true)) + serializer.Serialize(new BsonDataWriter(stream), obj, typeof(T)); var arr = memory.ToArray(); buffer.Write(arr.Length); buffer.Write(arr); @@ -56,8 +56,8 @@ namespace MLEM.Data { return default; var arr = buffer.ReadBytes(length); using (var memory = new MemoryStream(arr)) { - using (var gzip = new DeflateStream(memory, CompressionMode.Decompress, true)) - return serializer.Deserialize(new BsonDataReader(gzip)); + using (var stream = new DeflateStream(memory, CompressionMode.Decompress, true)) + return serializer.Deserialize(new BsonDataReader(stream)); } }