Skip to content

Commit 9c18838

Browse files
JesuHrztargos
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 84571ce commit 9c18838

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

lib/internal/fs/promises.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,8 @@ async function readFileHandle(filehandle, options) {
184184
} while (!endOfFile);
185185

186186
const result = Buffer.concat(chunks);
187-
if (options.encoding) {
188-
return result.toString(options.encoding);
189-
} else {
190-
return result;
191-
}
187+
188+
return options.encoding ? result.toString(options.encoding) : result;
192189
}
193190

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

0 commit comments

Comments
 (0)