Skip to content

Commit 609ca4d

Browse files
authored
Apply suggestions from code review
Co-authored-by: Athan <kgryte@gmail.com> Signed-off-by: Athan <kgryte@gmail.com>
1 parent 3328831 commit 609ca4d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/node_modules/@stdlib/blas/ext/base/zzero-to/benchmark/c/benchmark.length.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ static double benchmark1( int iterations, int len ) {
110110
for ( i = 0; i < iterations; i++ ) {
111111
// cppcheck-suppress uninitvar
112112
stdlib_strided_zzero_to( len, (stdlib_complex128_t *)x, 1 );
113-
if ( x[ 0 ] != x[ 0 ] ) {
113+
if ( x[ i%len ] != x[ i%len ] ) {
114114
printf( "should not return NaN\n" );
115115
break;
116116
}
117117
}
118118
elapsed = tic() - t;
119-
if ( x[ 0 ] != x[ 0 ] ) {
119+
if ( x[ i%len ] != x[ i%len ] ) {
120120
printf( "should not return NaN\n" );
121121
}
122122
free( x );
@@ -145,13 +145,13 @@ static double benchmark2( int iterations, int len ) {
145145
for ( i = 0; i < iterations; i++ ) {
146146
// cppcheck-suppress uninitvar
147147
stdlib_strided_zzero_to_ndarray( len, (stdlib_complex128_t *)x, 1, 0 );
148-
if ( x[ 0 ] != x[ 0 ] ) {
148+
if ( x[ i%len ] != x[ i%len ] ) {
149149
printf( "should not return NaN\n" );
150150
break;
151151
}
152152
}
153153
elapsed = tic() - t;
154-
if ( x[ 0 ] != x[ 0 ] ) {
154+
if ( x[ i%len ] != x[ i%len ] ) {
155155
printf( "should not return NaN\n" );
156156
}
157157
free( x );

0 commit comments

Comments
 (0)