diff options
author | Rich Trott <rtrott@gmail.com> | 2020-12-18 22:03:35 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2020-12-21 15:43:30 +0300 |
commit | fee3b89a2b11fc62b5e6e7f96e49871175244f57 (patch) | |
tree | 941ece96458eb0227a7d6cc64a830085cb43767e /benchmark | |
parent | 2070d5b52431c5fb4b35a07a998f0f9b9805e90a (diff) |
benchmark: reduce code duplication
Merge duplicate case code in child-process-params.js.
PR-URL: https://github.com/nodejs/node/pull/36568
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/child_process/child-process-params.js | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/benchmark/child_process/child-process-params.js b/benchmark/child_process/child-process-params.js index df930395b2a..8db8d3ace20 100644 --- a/benchmark/child_process/child-process-params.js +++ b/benchmark/child_process/child-process-params.js @@ -82,6 +82,7 @@ function main({ n, methodName, params }) { } break; case 'execFileSync': + case 'spawnSync': switch (params) { case 1: bench.start(); @@ -119,24 +120,5 @@ function main({ n, methodName, params }) { break; } break; - case 'spawnSync': - switch (params) { - case 1: - bench.start(); - for (let i = 0; i < n; i++) method(command); - bench.end(n); - break; - case 2: - bench.start(); - for (let i = 0; i < n; i++) method(command, args); - bench.end(n); - break; - case 3: - bench.start(); - for (let i = 0; i < n; i++) method(command, args, options); - bench.end(n); - break; - } - break; } } |