Skip to content

Commit 7d44334

Browse files
authored
Apply suggestions from code review
Signed-off-by: Athan <kgryte@gmail.com>
1 parent 3ff800e commit 7d44334

4 files changed

Lines changed: 5 additions & 6 deletions

File tree

lib/node_modules/@stdlib/stats/strided/nanmidrange/docs/repl.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
alternative indexing semantics.
5151

5252
While typed array views mandate a view offset based on the underlying
53-
buffer, the `offset` parameter supports indexing semantics based on a
54-
starting index.
53+
buffer, the offset parameter supports indexing semantics based on a starting
54+
index.
5555

5656
Parameters
5757
----------

lib/node_modules/@stdlib/stats/strided/nanmidrange/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ interface Routine {
4848
( N: number, x: InputArray, strideX: number ): number;
4949

5050
/**
51-
* Computes the mid-range of a strided array using alternative indexing semantics, ignoring `NaN` values.
51+
* Computes the mid-range of a strided array, ignoring `NaN` values and using alternative indexing semantics.
5252
*
5353
* @param N - number of indexed elements
5454
* @param x - input array

lib/node_modules/@stdlib/stats/strided/nanmidrange/lib/accessors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ function nanmidrange( N, x, strideX, offsetX ) {
6262

6363
// Cache a reference to the element accessor:
6464
get = x.accessors[ 0 ];
65+
6566
if ( N === 1 || strideX === 0 ) {
6667
v = get( xbuf, offsetX );
6768
if ( isnan( v ) ) {
6869
return NaN;
6970
}
7071
return v;
7172
}
72-
7373
ix = offsetX;
7474
for ( i = 0; i < N; i++ ) {
7575
v = get( xbuf, ix );

lib/node_modules/@stdlib/stats/strided/nanmidrange/lib/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@
2727
* var nanmidrange = require( '@stdlib/stats/strided/nanmidrange' );
2828
*
2929
* var x = [ 1.0, -2.0, 2.0, NaN ];
30-
* var N = x.length;
3130
*
32-
* var v = nanmidrange( N, x, 1 );
31+
* var v = nanmidrange( x.length, x, 1 );
3332
* // returns 0.0
3433
*
3534
* @example

0 commit comments

Comments
 (0)