Skip to content

Commit 025112c

Browse files
committed
fix: apply code review suggestion
1 parent 0eae9a9 commit 025112c

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lib/node_modules/@stdlib/blas/ext/base/dnannsumors/lib/ndarray.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,14 @@ function dnannsumors( N, x, strideX, offsetX, out, strideOut, offsetOut ) {
5353
var n;
5454
var i;
5555

56-
ix = offsetX;
57-
io = offsetOut;
58-
5956
sum = 0.0;
57+
io = offsetOut;
6058
if ( N <= 0 ) {
6159
out[ io ] = sum;
6260
out[ io+strideOut ] = 0;
6361
return out;
6462
}
63+
ix = offsetX;
6564
if ( strideX === 0 ) {
6665
if ( isnan( x[ ix ] ) ) {
6766
out[ io ] = sum;

lib/node_modules/@stdlib/blas/ext/base/dnannsumors/src/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* limitations under the License.
1717
*/
1818

19-
#include "stdlib/strided/base/stride2offset.h"
2019
#include "stdlib/blas/ext/base/dnannsumors.h"
20+
#include "stdlib/strided/base/stride2offset.h"
2121
#include "stdlib/math/base/assert/is_nan.h"
2222
#include "stdlib/blas/base/shared.h"
2323

@@ -51,11 +51,11 @@ double API_SUFFIX(stdlib_strided_dnannsumors_ndarray)( const CBLAS_INT N, const
5151
CBLAS_INT i;
5252

5353
sum = 0.0;
54-
ix = offsetX;
55-
*n = 0;
5654
if ( N <= 0 ) {
5755
return sum;
5856
}
57+
ix = offsetX;
58+
*n = 0;
5959
if ( strideX == 0 ) {
6060
if ( stdlib_base_is_nan( X[ 0 ] ) ) {
6161
return sum;

0 commit comments

Comments
 (0)