File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
lib/node_modules/@stdlib/array/base/put/benchmark Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -30,15 +30,17 @@ var put = require( './../lib' );
30
30
// MAIN //
31
31
32
32
bench ( pkg + '::no_broadcasting:len=100' , function benchmark ( b ) {
33
+ var idx ;
33
34
var x ;
34
35
var i ;
35
36
var v ;
36
37
37
- x = zeroTo ( 99 ) ;
38
+ x = zeroTo ( 100 ) ;
39
+ idx = zeroTo ( 100 ) ;
38
40
39
41
b . tic ( ) ;
40
42
for ( i = 0 ; i < b . iterations ; i ++ ) {
41
- v = put ( x , x , x , 'throw' ) ;
43
+ v = put ( x , idx , x , 'throw' ) ;
42
44
if ( typeof v !== 'object' ) {
43
45
b . fail ( 'should return an array' ) ;
44
46
}
@@ -52,15 +54,17 @@ bench( pkg+'::no_broadcasting:len=100', function benchmark( b ) {
52
54
} ) ;
53
55
54
56
bench ( pkg + '::broadcasting:len=100' , function benchmark ( b ) {
57
+ var idx ;
55
58
var x ;
56
59
var i ;
57
60
var v ;
58
61
59
- x = zeroTo ( 99 ) ;
62
+ x = zeroTo ( 100 ) ;
63
+ idx = zeroTo ( 100 ) ;
60
64
61
65
b . tic ( ) ;
62
66
for ( i = 0 ; i < b . iterations ; i ++ ) {
63
- v = put ( x , x , [ i ] , 'throw' ) ;
67
+ v = put ( x , idx , [ i ] , 'throw' ) ;
64
68
if ( typeof v !== 'object' ) {
65
69
b . fail ( 'should return an array' ) ;
66
70
}
You can’t perform that action at this time.
0 commit comments