Skip to content

Commit 17a1310

Browse files
authored
refactor: reduce assignment duplication
Signed-off-by: Athan <kgryte@gmail.com>
1 parent 47a6d6f commit 17a1310

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

  • lib/node_modules/@stdlib/blas/ext/base/gvander/lib

lib/node_modules/@stdlib/blas/ext/base/gvander/lib/base.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ function gvander( mode, M, N, x, strideX, offsetX, out, strideOut1, strideOut2,
122122
// Column-major...
123123
S0 = M;
124124
S1 = N;
125+
do0 = strideOut1;
126+
do1 = strideOut2 - ( S0*strideOut1 );
125127

126128
// Increasing: column j contains x^j
127129
if ( mode > 0 ) {
128130
gfill( S0, 1.0, out, strideOut1, offsetOut );
129-
do0 = strideOut1;
130-
do1 = strideOut2 - ( S0*strideOut1 );
131131
io = offsetOut + strideOut2;
132132
for ( i1 = 1; i1 < S1; i1++ ) {
133133
ix = offsetX;
@@ -142,8 +142,6 @@ function gvander( mode, M, N, x, strideX, offsetX, out, strideOut1, strideOut2,
142142
}
143143
// Decreasing: column 0 contains x^(N-1), last column all ones
144144
gfill( S0, 1.0, out, strideOut1, offsetOut + ( ( S1-1 ) * strideOut2 ) );
145-
do0 = strideOut1;
146-
do1 = strideOut2 - ( S0*strideOut1 );
147145
io = offsetOut + ( ( S1-2 ) * strideOut2 ) + ( ( S0-1 ) * strideOut1 );
148146
for ( i1 = S1-2; i1 >= 0; i1-- ) {
149147
ix = offsetX + ( ( S0-1 ) * sx );

0 commit comments

Comments
 (0)