File tree Expand file tree Collapse file tree
lib/node_modules/@stdlib/assert/contains/benchmark Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323var bench = require ( '@stdlib/bench' ) ;
2424var isBoolean = require ( '@stdlib/assert/is-boolean' ) . isPrimitive ;
2525var pow = require ( '@stdlib/math/base/special/pow' ) ;
26- var randu = require ( '@stdlib/random/base/randu' ) ;
2726var format = require ( '@stdlib/string/format' ) ;
2827var pkg = require ( './../package.json' ) . name ;
2928var contains = require ( './../lib' ) ;
@@ -62,7 +61,7 @@ function createBenchmark( fcn, len ) {
6261 b . tic ( ) ;
6362 for ( i = 0 ; i < b . iterations ; i ++ ) {
6463 // Note: we are testing the worst case scenario where a function must scan the entire array before finding a value.
65- x [ len - 2 ] = randu ( ) ;
64+ x [ len - 2 ] -= 1 ;
6665 bool = fcn ( x , len - 1 ) ;
6766 if ( typeof bool !== 'boolean' ) {
6867 b . fail ( 'should return a boolean' ) ;
You can’t perform that action at this time.
0 commit comments