File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -550,8 +550,8 @@ async function readFileHandle(filehandle, options) {
550550 totalRead += bytesRead ;
551551
552552 if ( bytesRead === 0 ||
553- totalRead === size ||
554- ( bytesRead !== buffer . length && ! chunkedRead && ! noSize ) ) {
553+ totalRead === size ||
554+ ( bytesRead !== buffer . length && ! chunkedRead && ! noSize ) ) {
555555 const singleRead = bytesRead === totalRead ;
556556
557557 const bytesToCheck = chunkedRead ? totalRead : bytesRead ;
@@ -574,11 +574,9 @@ async function readFileHandle(filehandle, options) {
574574 result += decoder . end ( buffer ) ;
575575 return result ;
576576 }
577-
578577 const readBuffer = bytesRead !== buffer . length ?
579578 buffer . subarray ( 0 , bytesRead ) :
580579 buffer ;
581-
582580 if ( encoding ) {
583581 result += decoder . write ( readBuffer ) ;
584582 } else if ( size !== 0 ) {
@@ -587,7 +585,6 @@ async function readFileHandle(filehandle, options) {
587585 buffers ??= [ ] ;
588586 // Unknown file size requires chunks.
589587 ArrayPrototypePush ( buffers , readBuffer ) ;
590-
591588 buffer = Buffer . allocUnsafeSlow ( kReadFileUnknownBufferLength ) ;
592589 }
593590 }
You can’t perform that action at this time.
0 commit comments