Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Oct 14, 2023
1 parent 292a358 commit bfcac9f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
11 changes: 2 additions & 9 deletions base/reverse/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

var args2multislice = require( '@stdlib/slice/base/args2multislice' );
var Slice = require( '@stdlib/slice/ctor' );
var filled = require( '@stdlib/array/base/filled' );
var slice = require( './../../../base/slice' );
var ndims = require( './../../../base/ndims' );

Expand Down Expand Up @@ -63,15 +64,7 @@ var ndims = require( './../../../base/ndims' );
* // returns [ [ 6.0, 5.0 ], [ 4.0, 3.0 ], [ 2.0, 1.0 ] ]
*/
function reverse( x, writable ) {
var args;
var N;
var i;

N = ndims( x );
args = [];
for ( i = 0; i < N; i++ ) {
args.push( new Slice( null, null, -1 ) );
}
var args = filled( new Slice( null, null, -1 ), ndims( x ) );
return slice( x, args2multislice( args ), true, writable );
}

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

Loading

0 comments on commit bfcac9f

Please sign in to comment.