Skip to content

Commit c4f05b5

Browse files
authored
Apply suggestions from code review
Signed-off-by: Athan <[email protected]>
1 parent ee344ba commit c4f05b5

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

lib/node_modules/@stdlib/stats/base/variancepn/lib/accessors.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ function variancepn( N, correction, x, strideX, offsetX ) {
7272
// Cache a reference to the element accessor:
7373
get = x.accessors[ 0 ];
7474

75-
if ( N === 1 || strideX === 0 ) {
76-
return 0.0;
77-
}
78-
7975
// Compute an estimate for the mean:
8076
mu = gsumpw( N, xbuf, strideX, offsetX ) / N;
8177

lib/node_modules/@stdlib/stats/base/variancepn/lib/ndarray.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,13 @@ function variancepn( N, correction, x, strideX, offsetX ) {
6666
if ( N <= 0 || n <= 0.0 ) {
6767
return NaN;
6868
}
69+
if ( N === 1 || strideX === 0 ) {
70+
return 0.0;
71+
}
6972
o = arraylike2object( x );
7073
if ( o.accessorProtocol ) {
7174
return accessors( N, correction, o, strideX, offsetX );
7275
}
73-
if ( N === 1 || strideX === 0 ) {
74-
return 0.0;
75-
}
76-
7776
// Compute an estimate for the mean:
7877
mu = gsumpw( N, x, strideX, offsetX ) / N;
7978

0 commit comments

Comments
 (0)