mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-01 05:18:27 +01:00
Removed nesting levels through block-scoped using statement (#10025)
Co-authored-by: John Doe <john@doe> Co-authored-by: Lehonti Ramos <lehonti@ramos>
This commit is contained in:
@@ -489,10 +489,8 @@ public class SkiaEncoder : IImageEncoder
|
||||
Directory.CreateDirectory(directory);
|
||||
using (var outputStream = new SKFileWStream(outputPath))
|
||||
{
|
||||
using (var pixmap = new SKPixmap(new SKImageInfo(width, height), saveBitmap.GetPixels()))
|
||||
{
|
||||
pixmap.Encode(outputStream, skiaOutputFormat, quality);
|
||||
}
|
||||
using var pixmap = new SKPixmap(new SKImageInfo(width, height), saveBitmap.GetPixels());
|
||||
pixmap.Encode(outputStream, skiaOutputFormat, quality);
|
||||
}
|
||||
|
||||
return outputPath;
|
||||
|
||||
@@ -111,10 +111,8 @@ public sealed class ImageProcessor : IImageProcessor, IDisposable
|
||||
public async Task ProcessImage(ImageProcessingOptions options, Stream toStream)
|
||||
{
|
||||
var file = await ProcessImage(options).ConfigureAwait(false);
|
||||
using (var fileStream = AsyncFile.OpenRead(file.Path))
|
||||
{
|
||||
await fileStream.CopyToAsync(toStream).ConfigureAwait(false);
|
||||
}
|
||||
using var fileStream = AsyncFile.OpenRead(file.Path);
|
||||
await fileStream.CopyToAsync(toStream).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -26,10 +26,8 @@ namespace Jellyfin.Extensions
|
||||
/// <returns>All lines in the stream.</returns>
|
||||
public static string[] ReadAllLines(this Stream stream, Encoding encoding)
|
||||
{
|
||||
using (StreamReader reader = new StreamReader(stream, encoding))
|
||||
{
|
||||
return ReadAllLines(reader).ToArray();
|
||||
}
|
||||
using StreamReader reader = new StreamReader(stream, encoding);
|
||||
return ReadAllLines(reader).ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user