File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
lib/node_modules/@stdlib/assert/is-numeric-array/benchmark Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 4
4
5
5
var bench = require ( '@stdlib/bench' ) ;
6
6
var isBoolean = require ( '@stdlib/assert/is-boolean' ) . isPrimitive ;
7
+ var fromCodePoint = require ( '@stdlib/string/from-code-point' ) ;
7
8
var pow = require ( '@stdlib/math/base/special/pow' ) ;
8
9
var pkg = require ( './../package.json' ) . name ;
9
10
var isNumericArray = require ( './../lib' ) ;
@@ -41,18 +42,17 @@ function createBenchmark( len ) {
41
42
b . tic ( ) ;
42
43
for ( i = 0 ; i < b . iterations ; i ++ ) {
43
44
// Note: we are testing the worst case scenario where a function must scan the entire array before finding a failing value.
44
- x [ len - 1 ] = String . fromCharCode ( i % 126 ) ;
45
+ x [ len - 1 ] = fromCodePoint ( i % 126 ) ;
45
46
bool = isNumericArray ( x ) ;
46
47
if ( ! isBoolean ( bool ) ) {
47
48
b . fail ( 'should return a boolean' ) ;
48
49
}
49
50
}
50
51
b . toc ( ) ;
51
- if ( isBoolean ( bool ) ) {
52
- b . pass ( 'benchmark finished' ) ;
53
- } else {
52
+ if ( ! isBoolean ( bool ) ) {
54
53
b . fail ( 'should return a boolean' ) ;
55
54
}
55
+ b . pass ( 'benchmark finished' ) ;
56
56
b . end ( ) ;
57
57
} // end FUNCTION benchmark()
58
58
} // end FUNCTION createBenchmark()
You can’t perform that action at this time.
0 commit comments