Skip to content

Commit 80f24eb

Browse files
committed
Use string utility
1 parent 5a37414 commit 80f24eb

File tree

1 file changed

+4
-4
lines changed
  • lib/node_modules/@stdlib/assert/is-numeric-array/benchmark

1 file changed

+4
-4
lines changed

lib/node_modules/@stdlib/assert/is-numeric-array/benchmark/benchmark.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
var bench = require( '@stdlib/bench' );
66
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
7+
var fromCodePoint = require( '@stdlib/string/from-code-point' );
78
var pow = require( '@stdlib/math/base/special/pow' );
89
var pkg = require( './../package.json' ).name;
910
var isNumericArray = require( './../lib' );
@@ -41,18 +42,17 @@ function createBenchmark( len ) {
4142
b.tic();
4243
for ( i = 0; i < b.iterations; i++ ) {
4344
// 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 );
4546
bool = isNumericArray( x );
4647
if ( !isBoolean( bool ) ) {
4748
b.fail( 'should return a boolean' );
4849
}
4950
}
5051
b.toc();
51-
if ( isBoolean( bool ) ) {
52-
b.pass( 'benchmark finished' );
53-
} else {
52+
if ( !isBoolean( bool ) ) {
5453
b.fail( 'should return a boolean' );
5554
}
55+
b.pass( 'benchmark finished' );
5656
b.end();
5757
} // end FUNCTION benchmark()
5858
} // end FUNCTION createBenchmark()

0 commit comments

Comments
 (0)