Skip to content

Commit fd2dd0d

Browse files
authored
refactor: avoid duplicated logic
Signed-off-by: Athan <[email protected]>
1 parent aaf5f5c commit fd2dd0d

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ function variancech( N, correction, x, strideX, offsetX ) {
6767
if ( N <= 0 || n <= 0.0 ) {
6868
return NaN;
6969
}
70+
if ( N === 1 || strideX === 0 ) {
71+
return 0.0;
72+
}
7073
o = arraylike2object( x );
7174
if ( o.accessorProtocol ) {
7275
return accessors( N, correction, o, strideX, offsetX );
7376
}
74-
if ( N === 1 || strideX === 0 ) {
75-
return 0.0;
76-
}
7777
ix = offsetX;
7878

7979
// Use an estimate for the mean:

0 commit comments

Comments
 (0)