From bd10854c65e040cf74477a077f1a7996babfec87 Mon Sep 17 00:00:00 2001 From: blarrise <61951559+blariise@users.noreply.github.com> Date: Sun, 14 Dec 2025 05:35:47 +0100 Subject: [PATCH 1/3] chore: fix JavaScript lint errors (issue #9032) --- 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: passed - 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 --- --- .../@stdlib/_tools/licenses/licenses/lib/recurse.js | 6 +++--- .../utils/async/reduce/benchmark/benchmark.js | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/node_modules/@stdlib/_tools/licenses/licenses/lib/recurse.js b/lib/node_modules/@stdlib/_tools/licenses/licenses/lib/recurse.js index 82041357487d..b8a69c0d87b5 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/licenses/lib/recurse.js +++ b/lib/node_modules/@stdlib/_tools/licenses/licenses/lib/recurse.js @@ -97,12 +97,12 @@ function recurse( cache, pkg ) { results.licenses = []; } else { debug( '%s has license information.', id ); - results.licenses = new Array( licenses.length ); + results.licenses = []; for ( i = 0; i < licenses.length; i++ ) { - results.licenses[ i ] = { + results.licenses.push({ 'src': fpath, 'name': licenses[ i ] - }; + }); } } // Insert the package results into the results cache: diff --git a/lib/node_modules/@stdlib/utils/async/reduce/benchmark/benchmark.js b/lib/node_modules/@stdlib/utils/async/reduce/benchmark/benchmark.js index c8858a587802..b64d52cb62f0 100644 --- a/lib/node_modules/@stdlib/utils/async/reduce/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/utils/async/reduce/benchmark/benchmark.js @@ -41,10 +41,10 @@ bench( pkg, function benchmark( b ) { clbk( null, acc ); } } - arr = new Array( 100 ); + arr = []; len = arr.length; for ( i = 0; i < len; i++ ) { - arr[ i ] = EPS; + arr.push( EPS ); } i = 0; b.tic(); @@ -86,10 +86,10 @@ bench( pkg+':series=false', function benchmark( b ) { opts = { 'series': false }; - arr = new Array( 100 ); + arr = []; len = arr.length; for ( i = 0; i < len; i++ ) { - arr[ i ] = EPS; + arr.push( EPS ); } i = 0; b.tic(); @@ -131,10 +131,10 @@ bench( pkg+':limit=3', function benchmark( b ) { opts = { 'limit': 3 }; - arr = new Array( 100 ); + arr = []; len = arr.length; for ( i = 0; i < len; i++ ) { - arr[ i ] = EPS; + arr.push( EPS ); } i = 0; b.tic(); From 17244a376c9a99e81119372ca57d71edc321a7fa Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 15 Dec 2025 19:55:18 -0800 Subject: [PATCH 2/3] bench: fix limits Signed-off-by: Athan --- .../@stdlib/utils/async/reduce/benchmark/benchmark.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/utils/async/reduce/benchmark/benchmark.js b/lib/node_modules/@stdlib/utils/async/reduce/benchmark/benchmark.js index b64d52cb62f0..241793f855c5 100644 --- a/lib/node_modules/@stdlib/utils/async/reduce/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/utils/async/reduce/benchmark/benchmark.js @@ -42,7 +42,7 @@ bench( pkg, function benchmark( b ) { } } arr = []; - len = arr.length; + len = 100; for ( i = 0; i < len; i++ ) { arr.push( EPS ); } @@ -87,7 +87,7 @@ bench( pkg+':series=false', function benchmark( b ) { 'series': false }; arr = []; - len = arr.length; + len = 100; for ( i = 0; i < len; i++ ) { arr.push( EPS ); } @@ -132,7 +132,7 @@ bench( pkg+':limit=3', function benchmark( b ) { 'limit': 3 }; arr = []; - len = arr.length; + len = 100; for ( i = 0; i < len; i++ ) { arr.push( EPS ); } From acb5f882fcb4facec1ff50ee4096059a1fc0d6c4 Mon Sep 17 00:00:00 2001 From: Athan Date: Mon, 15 Dec 2025 19:58:04 -0800 Subject: [PATCH 3/3] bench: refactor manual array creation Signed-off-by: Athan --- .../utils/async/reduce/benchmark/benchmark.js | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/lib/node_modules/@stdlib/utils/async/reduce/benchmark/benchmark.js b/lib/node_modules/@stdlib/utils/async/reduce/benchmark/benchmark.js index 241793f855c5..6dc618c5ee88 100644 --- a/lib/node_modules/@stdlib/utils/async/reduce/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/utils/async/reduce/benchmark/benchmark.js @@ -21,6 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); +var filledarray = require( '@stdlib/array/filled' ); var EPS = require( '@stdlib/constants/float64/eps' ); var pkg = require( './../package.json' ).name; var reduceAsync = require( './../lib' ); @@ -31,7 +32,6 @@ var reduceAsync = require( './../lib' ); bench( pkg, function benchmark( b ) { var arr; var acc; - var len; var i; function onItem( acc, v, i, clbk ) { @@ -41,11 +41,7 @@ bench( pkg, function benchmark( b ) { clbk( null, acc ); } } - arr = []; - len = 100; - for ( i = 0; i < len; i++ ) { - arr.push( EPS ); - } + arr = filledarray( EPS, 100, 'generic' ); i = 0; b.tic(); @@ -73,7 +69,6 @@ bench( pkg+':series=false', function benchmark( b ) { var opts; var arr; var acc; - var len; var i; function onItem( acc, v, i, clbk ) { @@ -86,11 +81,7 @@ bench( pkg+':series=false', function benchmark( b ) { opts = { 'series': false }; - arr = []; - len = 100; - for ( i = 0; i < len; i++ ) { - arr.push( EPS ); - } + arr = filledarray( EPS, 100, 'generic' ); i = 0; b.tic(); @@ -117,7 +108,6 @@ bench( pkg+':series=false', function benchmark( b ) { bench( pkg+':limit=3', function benchmark( b ) { var opts; var arr; - var len; var acc; var i; @@ -131,11 +121,7 @@ bench( pkg+':limit=3', function benchmark( b ) { opts = { 'limit': 3 }; - arr = []; - len = 100; - for ( i = 0; i < len; i++ ) { - arr.push( EPS ); - } + arr = filledarray( EPS, 100, 'generic' ); i = 0; b.tic();