Skip to content

Commit a80399b

Browse files
authored
refactor: avoid duplicate access
Signed-off-by: Athan <[email protected]>
1 parent 40267e0 commit a80399b

File tree

1 file changed

+3
-2
lines changed
  • lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/lib

1 file changed

+3
-2
lines changed

lib/node_modules/@stdlib/blas/ext/base/gnannsumkbn/lib/accessors.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,13 @@ function gnannsumkbn( N, x, strideX, offsetX, out, strideOut, offsetOut ) {
8585
sum = 0.0;
8686
ix = offsetX;
8787
if ( strideX === 0 ) {
88-
if ( isnan( xget( xbuf, ix ) ) ) {
88+
v = xget( xbuf, ix );
89+
if ( isnan( v ) ) {
8990
oset( obuf, offsetOut, sum );
9091
oset( obuf, offsetOut+strideOut, 0 );
9192
return out;
9293
}
93-
oset( obuf, offsetOut, xget( xbuf, ix ) * N );
94+
oset( obuf, offsetOut, v * N );
9495
oset( obuf, offsetOut+strideOut, N );
9596
return out;
9697
}

0 commit comments

Comments
 (0)