File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
lib/node_modules/@stdlib/assert/is-whitespace/benchmark Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 44
55var bench = require ( '@stdlib/bench' ) ;
66var isBoolean = require ( '@stdlib/assert/is-boolean' ) . isPrimitive ;
7+ var fromCodePoint = require ( '@stdlib/string/from-code-point' ) ;
78var pkg = require ( './../package.json' ) . name ;
89var isWhitespace = require ( './../lib' ) ;
910
@@ -17,7 +18,7 @@ bench( pkg+'::single-character', function benchmark( b ) {
1718
1819 b . tic ( ) ;
1920 for ( i = 0 ; i < b . iterations ; i ++ ) {
20- str = String . fromCharCode ( i % 200 ) ;
21+ str = fromCodePoint ( i % 200 ) ;
2122 bool = isWhitespace ( str ) ;
2223 if ( ! isBoolean ( bool ) ) {
2324 b . fail ( 'should return a boolean' ) ;
@@ -38,7 +39,7 @@ bench( pkg+'::string', function benchmark( b ) {
3839
3940 b . tic ( ) ;
4041 for ( i = 0 ; i < b . iterations ; i ++ ) {
41- str = ' \n\r\t\v ' + String . fromCharCode ( i % 200 ) ;
42+ str = ' \n\r\t\v ' + fromCodePoint ( i % 200 ) ;
4243 bool = isWhitespace ( str ) ;
4344 if ( ! isBoolean ( bool ) ) {
4445 b . fail ( 'should return a boolean' ) ;
You can’t perform that action at this time.
0 commit comments