Skip to content

Commit 9f392f0

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

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/node_modules/@stdlib/regexp/eol/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_EOL = 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 = 'beep boop\r\n'+String.fromCharCode( 97 + (i%26) )+'\r\nfoo bar';
21+
str = 'beep boop\r\n'+fromCodePoint( 97 + (i%26) )+'\r\nfoo bar';
2122
bool = RE_EOL.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)