Skip to content

Commit 1e64d34

Browse files
authored
refactor: remove unnecessary variable
Signed-off-by: Athan <kgryte@gmail.com>
1 parent 17a1310 commit 1e64d34

1 file changed

Lines changed: 6 additions & 8 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: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ function gvander( mode, M, N, x, strideX, offsetX, out, strideOut1, strideOut2,
6565
var do1;
6666
var S0;
6767
var S1;
68-
var sx;
6968
var io;
7069
var ix;
7170
var i0;
@@ -79,7 +78,6 @@ function gvander( mode, M, N, x, strideX, offsetX, out, strideOut1, strideOut2,
7978

8079
// Note on variable naming convention: S#, do#, io, i# where # corresponds to the loop number, with `0` being the innermost loop...
8180
isrm = isRowMajor( [ strideOut1, strideOut2 ] );
82-
sx = strideX;
8381

8482
if ( isrm ) {
8583
S0 = N;
@@ -98,23 +96,23 @@ function gvander( mode, M, N, x, strideX, offsetX, out, strideOut1, strideOut2,
9896
out[ io ] = out[ io-do0 ] * x[ ix ];
9997
io += do0;
10098
}
101-
ix += sx;
99+
ix += strideX;
102100
io += do1;
103101
}
104102
return out;
105103
}
106104
// Decreasing: x^(N-1), x^(N-2), ..., x^0
107105
do1 = strideOut1 - ( S0*strideOut2 );
108106
io = offsetOut + ( ( S1-1 ) * strideOut1 ) + ( ( S0-1 ) * strideOut2 );
109-
ix = offsetX + ( ( S1-1 ) * sx );
107+
ix = offsetX + ( ( S1-1 ) * strideX );
110108
for ( i1 = S1-1; i1 >= 0; i1-- ) {
111109
out[ io ] = 1.0;
112110
io -= do0;
113111
for ( i0 = 1; i0 < S0; i0++ ) {
114112
out[ io ] = out[ io+do0 ] * x[ ix ];
115113
io -= do0;
116114
}
117-
ix -= sx;
115+
ix -= strideX;
118116
io -= do1;
119117
}
120118
return out;
@@ -133,7 +131,7 @@ function gvander( mode, M, N, x, strideX, offsetX, out, strideOut1, strideOut2,
133131
ix = offsetX;
134132
for ( i0 = 0; i0 < S0; i0++ ) {
135133
out[ io ] = out[ io-strideOut2 ] * x[ ix ];
136-
ix += sx;
134+
ix += strideX;
137135
io += do0;
138136
}
139137
io += do1;
@@ -144,10 +142,10 @@ function gvander( mode, M, N, x, strideX, offsetX, out, strideOut1, strideOut2,
144142
gfill( S0, 1.0, out, strideOut1, offsetOut + ( ( S1-1 ) * strideOut2 ) );
145143
io = offsetOut + ( ( S1-2 ) * strideOut2 ) + ( ( S0-1 ) * strideOut1 );
146144
for ( i1 = S1-2; i1 >= 0; i1-- ) {
147-
ix = offsetX + ( ( S0-1 ) * sx );
145+
ix = offsetX + ( ( S0-1 ) * strideX );
148146
for ( i0 = S0-1; i0 >= 0; i0-- ) {
149147
out[ io ] = out[ io+strideOut2 ] * x[ ix ];
150-
ix -= sx;
148+
ix -= strideX;
151149
io -= do0;
152150
}
153151
io -= do1;

0 commit comments

Comments
 (0)