Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
lib: removes unnecessary else statement
  • Loading branch information
JesuHrz committed Apr 7, 2020
commit 36b9d102d5dbe054c1e10e54ea143fd049a8fca2
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