Skip to content

Commit

Permalink
fix: apply code review suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
headlessNode committed Oct 11, 2024
1 parent 0eae9a9 commit 025112c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,14 @@ function dnannsumors( N, x, strideX, offsetX, out, strideOut, offsetOut ) {
var n;
var i;

ix = offsetX;
io = offsetOut;

sum = 0.0;
io = offsetOut;
if ( N <= 0 ) {
out[ io ] = sum;
out[ io+strideOut ] = 0;
return out;
}
ix = offsetX;
if ( strideX === 0 ) {
if ( isnan( x[ ix ] ) ) {
out[ io ] = sum;
Expand Down
6 changes: 3 additions & 3 deletions lib/node_modules/@stdlib/blas/ext/base/dnannsumors/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* limitations under the License.
*/

#include "stdlib/strided/base/stride2offset.h"
#include "stdlib/blas/ext/base/dnannsumors.h"
#include "stdlib/strided/base/stride2offset.h"
#include "stdlib/math/base/assert/is_nan.h"
#include "stdlib/blas/base/shared.h"

Expand Down Expand Up @@ -51,11 +51,11 @@ double API_SUFFIX(stdlib_strided_dnannsumors_ndarray)( const CBLAS_INT N, const
CBLAS_INT i;

sum = 0.0;
ix = offsetX;
*n = 0;
if ( N <= 0 ) {
return sum;
}
ix = offsetX;
*n = 0;
if ( strideX == 0 ) {
if ( stdlib_base_is_nan( X[ 0 ] ) ) {
return sum;
Expand Down

0 comments on commit 025112c

Please sign in to comment.