Skip to content

Commit b622bf4

Browse files
committed
Use string utility
1 parent f5106d6 commit b622bf4

File tree

1 file changed

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

1 file changed

+3
-2
lines changed

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

+3-2
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 isASCII = 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 = isASCII( 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 = 'beep boop foo bar' + String.fromCharCode( i%200 );
42+
str = 'beep boop foo bar' + fromCodePoint( i%200 );
4243
bool = isASCII( str );
4344
if ( !isBoolean( bool ) ) {
4445
b.fail( 'should return a boolean' );

0 commit comments

Comments
 (0)