diff options
Diffstat (limited to 'src/Jellyfin.Extensions/StreamExtensions.cs')
| -rw-r--r-- | src/Jellyfin.Extensions/StreamExtensions.cs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Jellyfin.Extensions/StreamExtensions.cs b/src/Jellyfin.Extensions/StreamExtensions.cs index 9751d9d42..182996852 100644 --- a/src/Jellyfin.Extensions/StreamExtensions.cs +++ b/src/Jellyfin.Extensions/StreamExtensions.cs @@ -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> @@ -40,7 +38,7 @@ namespace Jellyfin.Extensions public static IEnumerable<string> ReadAllLines(this TextReader reader) { string? line; - while ((line = reader.ReadLine()) != null) + while ((line = reader.ReadLine()) is not null) { yield return line; } @@ -54,7 +52,7 @@ namespace Jellyfin.Extensions public static async IAsyncEnumerable<string> ReadAllLinesAsync(this TextReader reader) { string? line; - while ((line = await reader.ReadLineAsync().ConfigureAwait(false)) != null) + while ((line = await reader.ReadLineAsync().ConfigureAwait(false)) is not null) { yield return line; } |
