Skip to content

Commit 172380f

Browse files
authored
bench: apply review suggestion
Signed-off-by: Muhammad Haris <[email protected]>
1 parent cfab7bf commit 172380f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/node_modules/@stdlib/array/base/pluck/benchmark/benchmark.assign.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ bench( pkg+':assign', function benchmark( b ) {
3434
var out;
3535
var tmp;
3636
var x;
37+
var y;
3738
var i;
38-
var j;
3939

4040
x = new Array( 100 );
4141
for ( i = 0; i < x.length; i++ ) {
@@ -49,14 +49,14 @@ bench( pkg+':assign', function benchmark( b ) {
4949

5050
b.tic();
5151
for ( i = 0; i < b.iterations; i++ ) {
52-
x[ i % x.length ].y = randu();
53-
j = pluck.assign( x, 'y', out, 1, 0 );
54-
if ( typeof j !== 'object' ) {
52+
x[ i % x.length ][ i % 5 ] = randu();
53+
out = pluck.assign( x, 2, y, 1, 0 );
54+
if ( typeof out !== 'object' ) {
5555
b.fail( 'should return an array' );
5656
}
5757
}
5858
b.toc();
59-
if ( !isArray( j ) ) {
59+
if ( !isArray( out ) ) {
6060
b.fail( 'should return an array' );
6161
}
6262
b.pass( 'benchmark finished' );

0 commit comments

Comments
 (0)