Skip to content

Commit ef8dc22

Browse files
committed
refactor: use already defined variable
--- 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: na - 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 acd37d9 commit ef8dc22

File tree

1 file changed

+2
-2
lines changed
  • lib/node_modules/@stdlib/ndarray/base/unary-reduce-subarray-by/lib

1 file changed

+2
-2
lines changed

lib/node_modules/@stdlib/ndarray/base/unary-reduce-subarray-by/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ function unaryReduceSubarrayBy( fcn, arrays, dims, options, clbk, thisArg ) { //
396396
K = ndims - M;
397397

398398
// Verify that the output ndarray has the expected number of dimensions...
399-
if ( arr[ 1 ].shape.length !== K ) {
400-
throw new Error( format( 'invalid argument. Arrays which are not being reduced must have the same number of non-reduced dimensions. Input array shape: [%s]. Number of non-reduced dimensions: %d. Array shape: [%s] (index: %d).', join( shx, ',' ), K, join( arr[ 1 ].shape, ',' ), 1 ) );
399+
if ( y.shape.length !== K ) {
400+
throw new Error( format( 'invalid argument. Arrays which are not being reduced must have the same number of non-reduced dimensions. Input array shape: [%s]. Number of non-reduced dimensions: %d. Array shape: [%s] (index: %d).', join( shx, ',' ), K, join( y.shape, ',' ), 1 ) );
401401
}
402402
// Verify that any ancillary ndarrays have at least the number of non-reduced dimensions...
403403
for ( i = 2; i < N; i++ ) {

0 commit comments

Comments
 (0)