Skip to content

Commit

Permalink
lib: removes unnecessary else statement
Browse files Browse the repository at this point in the history
  • Loading branch information
JesuHrz committed Apr 7, 2020
1 parent 251b08d commit 36b9d10
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/internal/fs/promises.js
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 36b9d10

Please sign in to comment.