Skip to content

Commit c88827b

Browse files
committed
bench: refactor to use string interpolation in number/uint8/base/add
This commit refactors JavaScript benchmarks in number/uint8/base/add to use string interpolation via @stdlib/string/format instead of string concatenation when specifying benchmark names. This improves readability, facilitates easier debugging of malformed benchmark names, and enables future linting of benchmark names. --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent e57055b commit c88827b

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

lib/node_modules/@stdlib/number/uint8/base/add/benchmark/benchmark.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
var bench = require( '@stdlib/bench' );
2424
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
25+
var format = require( '@stdlib/string/format' );
2526
var pkg = require( './../package.json' ).name;
2627
var add = require( './../lib' );
2728

@@ -52,7 +53,7 @@ bench( pkg, function benchmark( b ) {
5253
b.end();
5354
});
5455

55-
bench( pkg+'::inline', function benchmark( b ) {
56+
bench( format( '%s::inline', pkg ), function benchmark( b ) {
5657
var x;
5758
var y;
5859
var i;

lib/node_modules/@stdlib/number/uint8/base/add/benchmark/benchmark.native.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
2525
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
2626
var tryRequire = require( '@stdlib/utils/try-require' );
27+
var format = require( '@stdlib/string/format' );
2728
var pkg = require( './../package.json' ).name;
2829

2930

@@ -37,7 +38,7 @@ var opts = {
3738

3839
// MAIN //
3940

40-
bench( pkg+'::native', opts, function benchmark( b ) {
41+
bench( format( '%s::native', pkg ), opts, function benchmark( b ) {
4142
var x;
4243
var y;
4344
var i;

0 commit comments

Comments
 (0)