Skip to content

Commit 03d02d7

Browse files
JesuHrzBethGriggs
authored andcommitted
fs: remove unnecessary else statement
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>
1 parent b957895 commit 03d02d7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/internal/fs/promises.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,8 @@ async function readFileHandle(filehandle, options) {
188188
} while (!endOfFile);
189189

190190
const result = Buffer.concat(chunks);
191-
if (options.encoding) {
192-
return result.toString(options.encoding);
193-
} else {
194-
return result;
195-
}
191+
192+
return options.encoding ? result.toString(options.encoding) : result;
196193
}
197194

198195
// All of the functions are defined as async in order to ensure that errors

0 commit comments

Comments
 (0)