Skip to content

Commit 790dbae

Browse files
committed
Use string utility
1 parent bbd823b commit 790dbae

File tree

1 file changed

+3
-3
lines changed
  • lib/node_modules/@stdlib/regexp/filename-posix/benchmark

1 file changed

+3
-3
lines changed

lib/node_modules/@stdlib/regexp/filename-posix/benchmark/benchmark.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// MODULES //
44

55
var bench = require( '@stdlib/bench' );
6+
var fromCodePoint = require( '@stdlib/string/from-code-point' );
67
var pkg = require( './../package.json' ).name;
78
var RE_FILENAME_POSIX = require( './../lib' );
89

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

1718
b.tic();
1819
for ( i = 0; i < b.iterations; i++ ) {
19-
str = '/foo/bar/beep/boop'+String.fromCharCode( 97 + (i%26) )+'.js';
20+
str = '/foo/bar/beep/boop'+fromCodePoint( 97 + (i%26) )+'.js';
2021
out = RE_FILENAME_POSIX.exec( str );
2122
if ( !out || !out.length ) {
2223
b.fail( 'should split a filename' );
@@ -25,8 +26,7 @@ bench( pkg, function benchmark( b ) {
2526
b.toc();
2627
if ( !out || !out.length ) {
2728
b.fail( 'should split a filename' );
28-
} else {
29-
b.pass( 'benchmark finished' );
3029
}
30+
b.pass( 'benchmark finished' );
3131
b.end();
3232
});

0 commit comments

Comments
 (0)