diff options
| author | Jan Müller <github@lonebyte.de> | 2023-09-16 12:40:05 +0200 |
|---|---|---|
| committer | Jan Müller <github@lonebyte.de> | 2023-09-16 12:40:05 +0200 |
| commit | fd022ee6850c364a9f3c2d8de2b06f26ee1b8abf (patch) | |
| tree | d2aec7c1a9ae2d2b77b5c764a99a4434a6e4a21c /src/Jellyfin.Extensions/StreamExtensions.cs | |
| parent | 79cff704ff4e00895a8d2b97ecbbea3e2f5f56fc (diff) | |
| parent | 61155adecd8a69bb476487f9fc81175b0c4185b7 (diff) | |
Merge branch 'master' into flac-hls-fixes
# Conflicts:
# Jellyfin.Api/Controllers/DynamicHlsController.cs
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; } |
