Browse Source

Remove try/finally

pull/3153/head
winscripter 1 month ago
parent
commit
2835528a72
  1. 7
      src/ImageSharp/Formats/Jxl/Processing/Decoder/JxlBoxContentDecoder.cs

7
src/ImageSharp/Formats/Jxl/Processing/Decoder/JxlBoxContentDecoder.cs

@ -59,8 +59,6 @@ internal sealed class JxlBoxContentDecoder
{ {
byte[] cache = ArrayPool<byte>.Shared.Rent(16384); byte[] cache = ArrayPool<byte>.Shared.Rent(16384);
try
{
if (this.codingMode == JxlBoxCodingMode.Brotli) if (this.codingMode == JxlBoxCodingMode.Brotli)
{ {
using BrotliStream brotli = new(stream, CompressionMode.Decompress, leaveOpen: true); using BrotliStream brotli = new(stream, CompressionMode.Decompress, leaveOpen: true);
@ -99,10 +97,7 @@ internal sealed class JxlBoxContentDecoder
} }
} }
} }
}
finally
{
ArrayPool<byte>.Shared.Return(cache); ArrayPool<byte>.Shared.Return(cache);
} }
} }
}

Loading…
Cancel
Save