Skip to content

Commit 6f328c9

Browse files
committed
fix: apply code review suggestion
1 parent d6045f1 commit 6f328c9

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,14 @@ function dnannsumkbn( N, x, strideX, offsetX, out, strideOut, offsetOut ) {
6565
var n;
6666
var i;
6767

68-
ix = offsetX;
69-
io = offsetOut;
70-
7168
sum = 0.0;
69+
io = offsetOut;
7270
if ( N <= 0 ) {
7371
out[ io ] = sum;
7472
out[ io+strideOut ] = 0;
7573
return out;
7674
}
75+
ix = offsetX;
7776
if ( strideX === 0 ) {
7877
if ( isnan( x[ ix ] ) ) {
7978
out[ io ] = sum;

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

Lines changed: 2 additions & 2 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/dnannsumkbn.h"
20+
#include "stdlib/strided/base/stride2offset.h"
2121
#include "stdlib/math/base/assert/is_nan.h"
2222
#include "stdlib/math/base/special/abs.h"
2323
#include "stdlib/blas/base/shared.h"
@@ -71,11 +71,11 @@ double API_SUFFIX(stdlib_strided_dnannsumkbn_ndarray)( const CBLAS_INT N, const
7171
double c;
7272

7373
sum = 0.0;
74-
ix = offsetX;
7574
*n = 0;
7675
if ( N <= 0 ) {
7776
return sum;
7877
}
78+
ix = offsetX;
7979
if ( strideX == 0 ) {
8080
if ( stdlib_base_is_nan( X[ ix ] ) ) {
8181
return sum;

0 commit comments

Comments
 (0)