Browse Source

do not use "await using"

pull/1574/head
Anton Firszov 6 years ago
parent
commit
8d3f05118e
  1. 4
      src/ImageSharp/Formats/ImageDecoderUtilities.cs

4
src/ImageSharp/Formats/ImageDecoderUtilities.cs

@ -22,7 +22,7 @@ namespace SixLabors.ImageSharp.Formats
return decoder.Identify(stream);
}
await using MemoryStream ms = decoder.Configuration.MemoryAllocator.AllocateFixedCapacityMemoryStream(stream.Length);
using MemoryStream ms = decoder.Configuration.MemoryAllocator.AllocateFixedCapacityMemoryStream(stream.Length);
await stream.CopyToAsync(ms).ConfigureAwait(false);
ms.Position = 0;
return decoder.Identify(ms);
@ -46,7 +46,7 @@ namespace SixLabors.ImageSharp.Formats
return decoder.Decode<TPixel>(stream);
}
await using MemoryStream ms = decoder.Configuration.MemoryAllocator.AllocateFixedCapacityMemoryStream(stream.Length);
using MemoryStream ms = decoder.Configuration.MemoryAllocator.AllocateFixedCapacityMemoryStream(stream.Length);
await stream.CopyToAsync(ms).ConfigureAwait(false);
ms.Position = 0;
return decoder.Decode<TPixel>(ms);

Loading…
Cancel
Save