Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
var getStride = require( '@stdlib/ndarray/base/stride' );
var getOffset = require( '@stdlib/ndarray/base/offset' );
var getData = require( '@stdlib/ndarray/base/data-buffer' );
var clipIndex = require( '@stdlib/ndarray/base/clip-index' );
var clipUpperIndex = require( '@stdlib/ndarray/base/clip-upper-index' );
var strided = require( '@stdlib/blas/ext/base/dlast-index-of-falsy' ).ndarray;


Expand Down Expand Up @@ -66,11 +66,11 @@
fromIndex = ndarraylike2scalar( arrays[ 1 ] );

N = numelDimension( x, 0 );
fromIndex = clipIndex( fromIndex, N );
if ( fromIndex >= N ) {
fromIndex = N - 1;
fromIndex = clipUpperIndex( fromIndex, ( fromIndex < 0 ) ? N : N-1 );
if ( fromIndex < 0 ) {
return -1;
}
return strided( fromIndex+1, getData( x ), getStride( x, 0 ), getOffset( x ) );

Check warning on line 73 in lib/node_modules/@stdlib/blas/ext/base/ndarray/dlast-index-of-falsy/lib/main.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

This line has a length of 83. Maximum allowed is 80
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
t.strictEqual( actual, 2, 'returns expected value' );

// Negative stride...
x = vector( new Float64Array( [ 1.0, 1.0, 0.0, 2.0, 0.0, 1.0 ] ), 6, -1, 5 );

Check warning on line 85 in lib/node_modules/@stdlib/blas/ext/base/ndarray/dlast-index-of-falsy/test/test.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

This line has a length of 81. Maximum allowed is 80
fromIndex = scalar2ndarray( 5, {
'dtype': 'generic'
});
Expand Down Expand Up @@ -170,7 +170,7 @@
'dtype': 'generic'
});
actual = dlastIndexOfFalsy( [ x, fromIndex ] );
t.strictEqual( actual, 0, 'returns expected value' );
t.strictEqual( actual, -1, 'returns expected value' );

t.end();
});
Expand Down
Loading