File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -253,7 +253,7 @@ Encoding encoding
253253 ) ;
254254
255255 await foreach (
256- var line in reader . ReadAllLinesAsync ( cancellationToken ) . ConfigureAwait ( false )
256+ var line in reader . ReadLinesAsync ( cancellationToken ) . ConfigureAwait ( false )
257257 )
258258 {
259259 await handleLineAsync ( line , cancellationToken ) . ConfigureAwait ( false ) ;
Original file line number Diff line number Diff line change @@ -9,16 +9,12 @@ internal static class TextReaderExtensions
99{
1010 extension ( TextReader reader )
1111 {
12- public async IAsyncEnumerable < string > ReadAllLinesAsync (
12+ public async IAsyncEnumerable < string > ReadLinesAsync (
1313 [ EnumeratorCancellation ] CancellationToken cancellationToken = default
1414 )
1515 {
16- while ( true )
16+ while ( await reader . ReadLineAsync ( cancellationToken ) . ConfigureAwait ( false ) is { } line )
1717 {
18- var line = await reader . ReadLineAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
19- if ( line is null )
20- yield break ;
21-
2218 yield return line ;
2319 }
2420 }
You can’t perform that action at this time.
0 commit comments