Skip to content

Commit 8668201

Browse files
committed
Use string utility
1 parent af06325 commit 8668201

File tree

1 file changed

+3
-3
lines changed
  • lib/node_modules/@stdlib/regexp/unc-path/benchmark

1 file changed

+3
-3
lines changed

lib/node_modules/@stdlib/regexp/unc-path/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_UNC_PATH = 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 = '\\\\server\\share\\foo\\bar\\baz:a:'+String.fromCharCode( 97 + (i%26) );
20+
str = '\\\\server\\share\\foo\\bar\\baz:a:'+fromCodePoint( 97 + (i%26) );
2021
out = RE_UNC_PATH.exec( str );
2122
if ( !out || !out.length ) {
2223
b.fail( 'should parse an UNC path' );
@@ -25,8 +26,7 @@ bench( pkg, function benchmark( b ) {
2526
b.toc();
2627
if ( !out || !out.length ) {
2728
b.fail( 'should parse an UNC path' );
28-
} else {
29-
b.pass( 'benchmark finished' );
3029
}
30+
b.pass( 'benchmark finished' );
3131
b.end();
3232
});

0 commit comments

Comments
 (0)