Skip to content

Commit 95bd536

Browse files
committed
Use string utility
1 parent 029fc4f commit 95bd536

File tree

1 file changed

+3
-2
lines changed
  • lib/node_modules/@stdlib/assert/is-whitespace/benchmark

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 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 pkg = require( './../package.json' ).name;
89
var isWhitespace = require( './../lib' );
910

@@ -17,7 +18,7 @@ bench( pkg+'::single-character', function benchmark( b ) {
1718

1819
b.tic();
1920
for ( i = 0; i < b.iterations; i++ ) {
20-
str = String.fromCharCode( i%200 );
21+
str = fromCodePoint( i%200 );
2122
bool = isWhitespace( str );
2223
if ( !isBoolean( bool ) ) {
2324
b.fail( 'should return a boolean' );
@@ -38,7 +39,7 @@ bench( pkg+'::string', function benchmark( b ) {
3839

3940
b.tic();
4041
for ( i = 0; i < b.iterations; i++ ) {
41-
str = ' \n\r\t\v ' + String.fromCharCode( i%200 );
42+
str = ' \n\r\t\v ' + fromCodePoint( i%200 );
4243
bool = isWhitespace( str );
4344
if ( !isBoolean( bool ) ) {
4445
b.fail( 'should return a boolean' );

0 commit comments

Comments
 (0)