mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
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>
This commit is contained in:
1 parent
83f7bb441f
commit
a6a15fefb6
1 file changed
+2
-5
@@ -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
|
||||
|
||||
Reference in new issue
Block a user