Skip to content

Commit 71e6a7f

Browse files
committed
fix: use computed order
--- 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 23f47b4 commit 71e6a7f

File tree

1 file changed

+2
-1
lines changed
  • lib/node_modules/@stdlib/ndarray/base/map/lib

1 file changed

+2
-1
lines changed

lib/node_modules/@stdlib/ndarray/base/map/lib/main.js

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

2323
var iterationOrder = require( '@stdlib/ndarray/base/iteration-order' );
24+
var strides2order = require( '@stdlib/ndarray/base/strides2order' );
2425
var ndarray2object = require( '@stdlib/ndarray/base/ndarraylike2object' );
2526
var blockedaccessormap2d = require( './2d_blocked_accessors.js' );
2627
var blockedaccessormap3d = require( './3d_blocked_accessors.js' );
@@ -244,7 +245,7 @@ function map( arrays, fcn, thisArg ) {
244245
ioy = iterationOrder( y.strides ); // +/-1
245246

246247
// Determine whether we can avoid blocked iteration...
247-
if ( iox !== 0 && ioy !== 0 && iox === ioy ) {
248+
if ( iox !== 0 && ioy !== 0 && strides2order( x.strides ) === strides2order( y.strides ) ) { // eslint-disable-line max-len
248249
// Determine whether we can use simple nested loops...
249250
if ( ndims <= MAX_DIMS ) {
250251
// So long as iteration for each respective array always moves in the same direction (i.e., no mixed sign strides), we can leverage cache-optimal (i.e., normal) nested loops without resorting to blocked iteration...

0 commit comments

Comments
 (0)