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 <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
  • Loading branch information
JesuHrz authored and targos committed Apr 30, 2020
1 parent 84571ce commit 9c18838
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 @@ -184,11 +184,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 9c18838

Please sign in to comment.