Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesus Hernandez <jesusbeckan@gmail.com>2020-04-05 01:53:29 +0300
committerLuigi Pinca <luigipinca@gmail.com>2020-04-19 08:58:44 +0300
commita6a15fefb6aea781d3e08f44633cd137ca2c844f (patch)
tree8a59eede3e1c7d1aa445aed920d67bd31d11209f /lib/internal/fs
parent83f7bb441fb647ccac88f4787ac0c308ebb146ab (diff)
fs: remove unnecessary else statement
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'lib/internal/fs')
-rw-r--r--lib/internal/fs/promises.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/internal/fs/promises.js b/lib/internal/fs/promises.js
index c93d89461ff..960ea5492d5 100644
--- a/lib/internal/fs/promises.js
+++ b/lib/internal/fs/promises.js
@@ -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