Skip to content

Commit f26fcbf

Browse files
committed
Use string utility
1 parent b622bf4 commit f26fcbf

File tree

1 file changed

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

1 file changed

+4
-4
lines changed

lib/node_modules/@stdlib/assert/is-capitalized/benchmark/benchmark.js

+4-4
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 pkg = require( './../package.json' ).name;
89
var isCapitalized = require( './../lib' );
910

@@ -16,16 +17,15 @@ bench( pkg, function benchmark( b ) {
1617

1718
b.tic();
1819
for ( i = 0; i < b.iterations; i++ ) {
19-
bool = isCapitalized( String.fromCharCode( i%126 ) );
20+
bool = isCapitalized( fromCodePoint( i%126 ) );
2021
if ( !isBoolean( bool ) ) {
2122
b.fail( 'should return a boolean' );
2223
}
2324
}
2425
b.toc();
25-
if ( isBoolean( bool ) ) {
26-
b.pass( 'benchmark finished' );
27-
} else {
26+
if ( !isBoolean( bool ) ) {
2827
b.fail( 'should return a boolean' );
2928
}
29+
b.pass( 'benchmark finished' );
3030
b.end();
3131
});

0 commit comments

Comments
 (0)