Skip to content

Commit 41df879

Browse files
authored
fix: ensure original input array is passed to callback
Signed-off-by: Gururaj Gurram <[email protected]>
1 parent 4b34ad3 commit 41df879

File tree

1 file changed

+3
-3
lines changed
  • lib/node_modules/@stdlib/stats/base/nanrange-by/lib

1 file changed

+3
-3
lines changed

lib/node_modules/@stdlib/stats/base/nanrange-by/lib/accessors.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ function nanrangeBy( N, x, strideX, offsetX, clbk, thisArg ) {
6767
get = x.accessors[0];
6868

6969
if ( N === 1 || strideX === 0 ) {
70-
v = clbk.call( thisArg, get( xbuf, offsetX ), 0, offsetX, x );
70+
v = clbk.call( thisArg, get( xbuf, offsetX ), 0, offsetX, xbuf );
7171
if ( v === void 0 || isnan( v ) ) {
7272
return NaN;
7373
}
7474
return 0.0;
7575
}
7676
ix = offsetX;
7777
for ( i = 0; i < N; i++ ) {
78-
min = clbk.call( thisArg, get( xbuf, ix ), i, ix, x );
78+
min = clbk.call( thisArg, get( xbuf, ix ), i, ix, xbuf );
7979
if ( min === min && min !== void 0 ) {
8080
break;
8181
}
@@ -88,7 +88,7 @@ function nanrangeBy( N, x, strideX, offsetX, clbk, thisArg ) {
8888
i += 1;
8989
for ( i; i < N; i++ ) {
9090
ix += strideX;
91-
v = clbk.call( thisArg, get( xbuf, ix ), i, ix, x );
91+
v = clbk.call( thisArg, get( xbuf, ix ), i, ix, xbuf );
9292
if ( v === void 0 || isnan( v ) ) {
9393
continue;
9494
}

0 commit comments

Comments
 (0)