Skip to content

Commit b22a9ed

Browse files
committed
Use string utility
1 parent f460c24 commit b22a9ed

File tree

1 file changed

+4
-4
lines changed
  • lib/node_modules/@stdlib/regexp/function-name/benchmark

1 file changed

+4
-4
lines changed

lib/node_modules/@stdlib/regexp/function-name/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 isString = require( '@stdlib/assert/is-string' ).isPrimitive;
7+
var fromCodePoint = require( '@stdlib/string/from-code-point' );
78
var pkg = require( './../package.json' ).name;
89
var RE_FUNCTION_NAME = require( './../lib' );
910

@@ -17,17 +18,16 @@ bench( pkg, function benchmark( b ) {
1718

1819
b.tic();
1920
for ( i = 0; i < b.iterations; i++ ) {
20-
str = 'function be'+String.fromCharCode( 97 + (i%26) )+'ep () {}';
21+
str = 'function be'+fromCodePoint( 97 + (i%26) )+'ep () {}';
2122
out = RE_FUNCTION_NAME.exec( str )[ 1 ];
2223
if ( !isString( out ) ) {
2324
b.fail( 'should return a string' );
2425
}
2526
}
2627
b.toc();
27-
if ( isString( out ) ) {
28-
b.pass( 'benchmark finished' );
29-
} else {
28+
if ( !isString( out ) ) {
3029
b.fail( 'should return a string' );
3130
}
31+
b.pass( 'benchmark finished' );
3232
b.end();
3333
});

0 commit comments

Comments
 (0)