Skip to content

Commit 59349fd

Browse files
headlessNodeNeerajpathak07
authored andcommitted
refactor: remove unnecessary variable declaration
PR-URL: stdlib-js#3185 Reviewed-by: Athan Reines <[email protected]>
1 parent 7f76495 commit 59349fd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/benchmark/c/benchmark.length.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ static double benchmark1( int iterations, int len ) {
114114
n = 0;
115115
t = tic();
116116
for ( i = 0; i < iterations; i++ ) {
117+
// cppcheck-suppress uninitvar
117118
v = stdlib_strided_dnannsumkbn2( len, x, 1, &n );
118119
if ( v != v || n < 0 ) {
119120
printf( "should not return NaN\n" );
@@ -153,6 +154,7 @@ static double benchmark2( int iterations, int len ) {
153154
n = 0;
154155
t = tic();
155156
for ( i = 0; i < iterations; i++ ) {
157+
// cppcheck-suppress uninitvar
156158
v = stdlib_strided_dnannsumkbn2_ndarray( len, x, 1, 0, &n );
157159
if ( v != v || n < 0 ) {
158160
printf( "should not return NaN\n" );

lib/node_modules/@stdlib/blas/ext/base/dnannsumkbn2/src/addon.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ static napi_value addon( napi_env env, napi_callback_info info ) {
4242
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, Out, 2, strideOut, argv, 3 );
4343

4444
int64_t io = stdlib_strided_stride2offset( 2, strideOut );
45-
double *out = Out;
4645
CBLAS_INT n;
47-
out[ io ] = API_SUFFIX(stdlib_strided_dnannsumkbn2)( N, X, strideX, &n );
48-
out[ io+strideOut ] = (double)n;
46+
Out[ io ] = API_SUFFIX(stdlib_strided_dnannsumkbn2)( N, X, strideX, &n );
47+
Out[ io+strideOut ] = (double)n;
4948

5049
return NULL;
5150
}
@@ -67,10 +66,9 @@ static napi_value addon_method( napi_env env, napi_callback_info info ) {
6766
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 );
6867
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, Out, 2, strideOut, argv, 4 );
6968

70-
double *out = Out;
7169
CBLAS_INT n;
72-
out[ offsetOut ] = API_SUFFIX(stdlib_strided_dnannsumkbn2_ndarray)( N, X, strideX, offsetX, &n );
73-
out[ offsetOut+strideOut ] = (double)n;
70+
Out[ offsetOut ] = API_SUFFIX(stdlib_strided_dnannsumkbn2_ndarray)( N, X, strideX, offsetX, &n );
71+
Out[ offsetOut+strideOut ] = (double)n;
7472

7573
return NULL;
7674
}

0 commit comments

Comments
 (0)