From fee3b89a2b11fc62b5e6e7f96e49871175244f57 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 18 Dec 2020 11:03:35 -0800 Subject: [PATCH] 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 Reviewed-By: Antoine du Hamel Reviewed-By: Anna Henningsen --- .../child_process/child-process-params.js | 20 +------------------ 1 file changed, 1 insertion(+), 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; } }