Skip to content

Commit f16dbf1

Browse files
committed
Fix bug failing to account for ndarray views having overlapping elements
1 parent a7ef61a commit f16dbf1

File tree

1 file changed

+0
-4
lines changed
  • lib/node_modules/@stdlib/ndarray/base/vind2bind/lib

1 file changed

+0
-4
lines changed

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

-4
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ function vind2bind( shape, strides, offset, order, idx, mode ) {
7878
} else if ( idx < 0 || idx >= len ) {
7979
throw new RangeError( 'invalid argument. Linear index must not exceed array dimensions. Number of array elements: ' + len + '. Value: `' + idx + '`.' );
8080
}
81-
// Trivial case where the offset into the underlying data buffer is 0...
82-
if ( offset === 0 ) {
83-
return idx;
84-
}
8581
// The approach which follows is to resolve a view index to its subscripts and then plug the subscripts into the standard formula for computing the linear index in the underlying data buffer...
8682
ind = offset;
8783
if ( order === 'column-major' ) {

0 commit comments

Comments
 (0)