From 36b9d102d5dbe054c1e10e54ea143fd049a8fca2 Mon Sep 17 00:00:00 2001 From: Jesus Hernandez Date: Sat, 4 Apr 2020 17:53:29 -0500 Subject: [PATCH] lib: removes unnecessary else statement --- lib/internal/fs/promises.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/internal/fs/promises.js b/lib/internal/fs/promises.js index d04e84aa9aa859..508fa94c488bd0 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