Skip to content

Commit d3208f5

Browse files
committed
Use string utility
1 parent 9f392f0 commit d3208f5

File tree

1 file changed

+4
-4
lines changed
  • lib/node_modules/@stdlib/regexp/extended-length-path/benchmark

1 file changed

+4
-4
lines changed

lib/node_modules/@stdlib/regexp/extended-length-path/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 RE_EXTENDED_LENGTH_PATH = 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 = '\\\\?\\C:\\foo\\bar\\'+String.fromCharCode( 97 + (i%26) )+'.js';
21+
str = '\\\\?\\C:\\foo\\bar\\'+fromCodePoint( 97 + (i%26) )+'.js';
2122
bool = RE_EXTENDED_LENGTH_PATH.test( str );
2223
if ( !isBoolean( bool ) ) {
2324
b.fail( 'should return a boolean' );
2425
}
2526
}
2627
b.toc();
27-
if ( isBoolean( bool ) ) {
28-
b.pass( 'benchmark finished' );
29-
} else {
28+
if ( !isBoolean( bool ) ) {
3029
b.fail( 'should return a boolean' );
3130
}
31+
b.pass( 'benchmark finished' );
3232
b.end();
3333
});

0 commit comments

Comments
 (0)