Skip to content

Commit acd4315

Browse files
Update test.instance.set_nd.js
Signed-off-by: Suyash Pathak <suyashp271@gmail.com>
1 parent 0472076 commit acd4315

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

lib/node_modules/@stdlib/ndarray/fancy/test/test.instance.set_nd.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,22 @@ tape( 'a FancyArray constructor returns an instance which has a `set` method whi
7373
}
7474
t.end();
7575

76-
function badValue( value, dim ) {
77-
return function badValue() {
78-
var args = new Array( shape.length+1 );
79-
var i;
80-
81-
for ( i = 0; i < shape.length; i++ ) {
82-
if ( i === dim ) {
83-
args[ i ] = value;
84-
} else {
85-
args[ i ] = 0;
86-
}
76+
function badValue( value, dim ) {
77+
return function badValue() {
78+
var args = [];
79+
var i;
80+
81+
for ( i = 0; i < shape.length; i++ ) {
82+
if ( i === dim ) {
83+
args.push( value );
84+
} else {
85+
args.push( 0 );
8786
}
88-
args[ i ] = 10.0;
89-
arr.set.apply( arr, args );
90-
};
91-
}
87+
}
88+
args.push( 10.0 );
89+
arr.set.apply( arr, args );
90+
};
91+
}
9292
});
9393

9494
tape( 'a FancyArray constructor returns an instance which has a `set` method for setting an array element using subscripts (>4d; row-major)', function test( t ) {

0 commit comments

Comments
 (0)