Skip to content

Commit

Permalink
lib: remove unnecesary else block
Browse files Browse the repository at this point in the history
The if statement inside the _writeHostObject function
returns an expression which makes the else block unnecessary.

PR-URL: #32644
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
  • Loading branch information
ddazal authored and targos committed Apr 30, 2020
1 parent 6ddf37c commit 84571ce
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/internal/child_process/serialization.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
}

Expand Down

0 comments on commit 84571ce

Please sign in to comment.