Skip to content

Commit 5418177

Browse files
committed
refactor: use macro to convert stride to offset
1 parent 8248b4a commit 5418177

File tree

1 file changed

+2
-10
lines changed
  • lib/node_modules/@stdlib/blas/base/dcopy/src

1 file changed

+2
-10
lines changed

lib/node_modules/@stdlib/blas/base/dcopy/src/dcopy.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,8 @@ void API_SUFFIX(c_dcopy)( const CBLAS_INT N, const double *X, const CBLAS_INT st
6161
}
6262
return;
6363
}
64-
if ( strideX < 0 ) {
65-
ix = (1-N) * strideX;
66-
} else {
67-
ix = 0;
68-
}
69-
if ( strideY < 0 ) {
70-
iy = (1-N) * strideY;
71-
} else {
72-
iy = 0;
73-
}
64+
ix = STDLIB_BLAS_BASE_STRIDE2OFFSET( N, strideX );
65+
iy = STDLIB_BLAS_BASE_STRIDE2OFFSET( N, strideY );
7466
for ( i = 0; i < N; i++ ) {
7567
Y[ iy ] = X[ ix ];
7668
ix += strideX;

0 commit comments

Comments
 (0)