From 83f7bb441fb647ccac88f4787ac0c308ebb146ab Mon Sep 17 00:00:00 2001 From: David Daza <03dazal@gmail.com> Date: Fri, 3 Apr 2020 12:53:55 -0500 Subject: [PATCH] lib: remove unnecesary else block MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The if statement inside the _writeHostObject function returns an expression which makes the else block unnecessary. PR-URL: https://github.com/nodejs/node/pull/32644 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater Reviewed-By: Juan José Arboleda --- lib/internal/child_process/serialization.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/internal/child_process/serialization.js b/lib/internal/child_process/serialization.js index 9f03a8e8446c43..df8a6ca67236c5 100644 --- a/lib/internal/child_process/serialization.js +++ b/lib/internal/child_process/serialization.js @@ -25,10 +25,9 @@ class ChildProcessSerializer extends v8.DefaultSerializer { if (isArrayBufferView(object)) { this.writeUint32(kArrayBufferViewTag); return super._writeHostObject(object); - } else { - this.writeUint32(kNotArrayBufferViewTag); - this.writeValue({ ...object }); } + this.writeUint32(kNotArrayBufferViewTag); + this.writeValue({ ...object }); } }