Skip to content

Commit

Permalink
fs: remove unnecessary else statement
Browse files Browse the repository at this point in the history
PR-URL: nodejs#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 lpinca committed Apr 19, 2020
1 parent 83f7bb4 commit a6a15fe
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 a6a15fe

Please sign in to comment.