benchmark: refactor to use template string
PR-URL: https://github.com/nodejs/node/pull/17313 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
76dbde19a7
commit
fae23a1a91
@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, {
|
|||||||
|
|
||||||
function main(conf) {
|
function main(conf) {
|
||||||
const n = +conf.n;
|
const n = +conf.n;
|
||||||
const fn = zlib['create' + conf.type];
|
const fn = zlib[`create${conf.type}`];
|
||||||
if (typeof fn !== 'function')
|
if (typeof fn !== 'function')
|
||||||
throw new Error('Invalid zlib type');
|
throw new Error('Invalid zlib type');
|
||||||
var i = 0;
|
var i = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user