Skip to content

Commit

Permalink
fs: remove unnecessary else statement
Browse files Browse the repository at this point in the history
PR-URL: #32662
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
  • Loading branch information
JesuHrz authored and BethGriggs committed Apr 27, 2020
1 parent b957895 commit 03d02d7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/internal/fs/promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,8 @@ async function readFileHandle(filehandle, options) {
} while (!endOfFile);

const result = Buffer.concat(chunks);
if (options.encoding) {
return result.toString(options.encoding);
} else {
return result;
}

return options.encoding ? result.toString(options.encoding) : result;
}

// All of the functions are defined as async in order to ensure that errors
Expand Down

0 comments on commit 03d02d7

Please sign in to comment.