Skip to content

Commit 0f64a9c

Browse files
authored
refactor: use base array utility
Signed-off-by: Athan <kgryte@gmail.com>
1 parent 7b25516 commit 0f64a9c

File tree

1 file changed

+2
-5
lines changed
  • lib/node_modules/@stdlib/utils/timeit/lib

1 file changed

+2
-5
lines changed

lib/node_modules/@stdlib/utils/timeit/lib/main.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var copy = require( '@stdlib/utils/copy' );
2727
var cwd = require( '@stdlib/process/cwd' );
2828
var format = require( '@stdlib/string/format' );
2929
var nextTick = require( '@stdlib/utils/next-tick' );
30+
var nulls = require( '@stdlib/array/base/nulls' );
3031
var defaults = require( './defaults.json' );
3132
var validate = require( './validate.js' );
3233
var evaluate = require( './vm_evaluate.js' );
@@ -83,7 +84,6 @@ function timeit( code, options, clbk ) {
8384
var err;
8485
var idx;
8586
var cb;
86-
var i;
8787

8888
if ( !isString( code ) ) {
8989
throw new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', code ) );
@@ -101,10 +101,7 @@ function timeit( code, options, clbk ) {
101101
if ( !isFunction( cb ) ) {
102102
throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', cb ) );
103103
}
104-
results = [ ];
105-
for ( i = 0; i < opts.repeats; i++ ) {
106-
results[ i ] = 0;
107-
}
104+
results = nulls( opts.repeats );
108105
dir = cwd();
109106
idx = 0;
110107

0 commit comments

Comments
 (0)