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 d6045f1 commit 6f328c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,14 @@ function dnannsumkbn( 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
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn/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/dnannsumkbn.h"
#include "stdlib/strided/base/stride2offset.h"
#include "stdlib/math/base/assert/is_nan.h"
#include "stdlib/math/base/special/abs.h"
#include "stdlib/blas/base/shared.h"
Expand Down Expand Up @@ -71,11 +71,11 @@ double API_SUFFIX(stdlib_strided_dnannsumkbn_ndarray)( const CBLAS_INT N, const
double c;

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

0 comments on commit 6f328c9

Please sign in to comment.