@@ -323,7 +323,7 @@ function unaryReduceSubarray( fcn, arrays, dims, options ) { // eslint-disable-l
323
323
}
324
324
// Determine whether we can avoid iteration altogether...
325
325
if ( K === 0 ) {
326
- if ( x . accessorProtocol || y . accessorProtocol ) {
326
+ if ( y . accessorProtocol ) {
327
327
return ACCESSOR_UNARY [ K ] ( fcn , arr , opts ) ;
328
328
}
329
329
return UNARY [ K ] ( fcn , arr , opts ) ;
@@ -376,7 +376,7 @@ function unaryReduceSubarray( fcn, arrays, dims, options ) { // eslint-disable-l
376
376
377
377
// Determine whether we only have one loop dimension and can thus readily perform one-dimensional iteration...
378
378
if ( K === 1 ) {
379
- if ( x . accessorProtocol || y . accessorProtocol ) {
379
+ if ( y . accessorProtocol ) {
380
380
return ACCESSOR_UNARY [ K ] ( fcn , arr , views , sl , opts ) ;
381
381
}
382
382
return UNARY [ K ] ( fcn , arr , views , sl , opts ) ;
@@ -396,7 +396,7 @@ function unaryReduceSubarray( fcn, arrays, dims, options ) { // eslint-disable-l
396
396
arr [ j ] . strides = [ arr [ j ] . strides [ i ] ] ;
397
397
}
398
398
sl = [ sl [ i ] ] ;
399
- if ( x . accessorProtocol || y . accessorProtocol ) {
399
+ if ( y . accessorProtocol ) {
400
400
return ACCESSOR_UNARY [ 1 ] ( fcn , arr , views , sl , opts ) ;
401
401
}
402
402
return UNARY [ 1 ] ( fcn , arr , views , sl , opts ) ;
@@ -407,7 +407,7 @@ function unaryReduceSubarray( fcn, arrays, dims, options ) { // eslint-disable-l
407
407
// Determine whether we can avoid blocked iteration...
408
408
if ( iox !== 0 && ioy !== 0 && iox === ioy && K <= MAX_DIMS ) {
409
409
// 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...
410
- if ( x . accessorProtocol || y . accessorProtocol ) {
410
+ if ( y . accessorProtocol ) {
411
411
return ACCESSOR_UNARY [ K ] ( fcn , arr , views , sl , opts ) ;
412
412
}
413
413
return UNARY [ K ] ( fcn , arr , views , sl , opts ) ;
@@ -416,13 +416,13 @@ function unaryReduceSubarray( fcn, arrays, dims, options ) { // eslint-disable-l
416
416
417
417
// Determine whether we can perform blocked iteration...
418
418
if ( K <= MAX_DIMS ) {
419
- if ( x . accessorProtocol || y . accessorProtocol ) {
419
+ if ( y . accessorProtocol ) {
420
420
return BLOCKED_ACCESSOR_UNARY [ K - 2 ] ( fcn , arr , views , sl , opts ) ;
421
421
}
422
422
return BLOCKED_UNARY [ K - 2 ] ( fcn , arr , views , sl , opts ) ;
423
423
}
424
424
// Fall-through to linear view iteration without regard for how data is stored in memory (i.e., take the slow path)...
425
- if ( x . accessorProtocol || y . accessorProtocol ) {
425
+ if ( y . accessorProtocol ) {
426
426
return accessorunarynd ( fcn , arr , views , sl , opts ) ;
427
427
}
428
428
unarynd ( fcn , arr , views , sl , opts ) ;
0 commit comments