Skip to content

Commit 8d1be60

Browse files
committed
refactor: remove unnecessary variable
1 parent 07c9202 commit 8d1be60

File tree

1 file changed

+1
-4
lines changed
  • lib/node_modules/@stdlib/ndarray/reject/lib

1 file changed

+1
-4
lines changed

lib/node_modules/@stdlib/ndarray/reject/lib/main.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ function reject( x, options, predicate, thisArg ) {
7979
var clbk;
8080
var opts;
8181
var ctor;
82-
var cidx;
8382
var ctx;
8483
var ord;
8584
var dim;
@@ -166,16 +165,14 @@ function reject( x, options, predicate, thisArg ) {
166165
};
167166

168167
// Filter elements according to a predicate function...
169-
cidx = -1;
170168
for ( i = 0; i < N; i++ ) {
171169
if ( i > 0 ) {
172170
idx = nextCartesianIndex( sh, ord, idx, dim, idx );
173171
}
174172
v = x.get.apply( x, idx );
175173
if ( !clbk.call( ctx, v, idx.slice(), x ) ) {
174+
cache[ cache.length ] = v;
176175
cache.length += 1;
177-
cidx += 1;
178-
cache[ cidx ] = v;
179176
}
180177
}
181178
// Retrieve the number of cached elements:

0 commit comments

Comments
 (0)