Skip to content

Commit 7bd774a

Browse files
committed
fix: apply suggestions from code review
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown_pkg_readmes status: na - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 4be90d5 commit 7bd774a

2 files changed

Lines changed: 7 additions & 15 deletions

File tree

lib/node_modules/@stdlib/blas/ext/base/gediff/lib/accessors.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,11 @@ var gcopy = require( '@stdlib/blas/base/gcopy' ).ndarray;
3838
* @param {integer} strideX - stride length for `x`
3939
* @param {NonNegativeInteger} offsetX - starting index for `x`
4040
* @param {NonNegativeInteger} N1 - number of indexed elements to prepend
41-
* @param {Object} prepend - prepend array object
42-
* @param {Collection} prepend.data - prepend array data
43-
* @param {Array<Function>} prepend.accessors - array element accessors
41+
* @param {NumericArray} prepend - prepend array
4442
* @param {integer} strideP - stride length for `prepend`
4543
* @param {NonNegativeInteger} offsetP - starting index for `prepend`
4644
* @param {NonNegativeInteger} N2 - number of indexed elements to append
47-
* @param {Object} append - append array object
48-
* @param {Collection} append.data - append array data
49-
* @param {Array<Function>} append.accessors - array element accessors
45+
* @param {NumericArray} append - append array
5046
* @param {integer} strideA - stride length for `append`
5147
* @param {NonNegativeInteger} offsetA - starting index for `append`
5248
* @param {Object} out - output array object
@@ -65,7 +61,7 @@ var gcopy = require( '@stdlib/blas/base/gcopy' ).ndarray;
6561
* var a = [ 22.0 ];
6662
* var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];
6763
*
68-
* gediff( x.length, arraylike2object( toAccessorArray( x ) ), 1, 0, 1, arraylike2object( toAccessorArray( p ) ), 1, 0, 1, arraylike2object( toAccessorArray( a ) ), 1, 0, arraylike2object( toAccessorArray( out ) ), 1, 0 );
64+
* gediff( x.length, arraylike2object( toAccessorArray( x ) ), 1, 0, 1, p, 1, 0, 1, a, 1, 0, arraylike2object( toAccessorArray( out ) ), 1, 0 );
6965
* // out => [ 1.0, 2.0, 3.0, 4.0, 5.0, 22.0 ]
7066
*/
7167
function gediff( N, x, strideX, offsetX, N1, prepend, strideP, offsetP, N2, append, strideA, offsetA, out, strideOut, offsetOut ) {
@@ -85,7 +81,7 @@ function gediff( N, x, strideX, offsetX, N1, prepend, strideP, offsetP, N2, appe
8581
oset = out.accessors[ 1 ];
8682

8783
// Copy `prepend` into output array:
88-
gcopy( N1, prepend.data, strideP, offsetP, obuf, strideOut, offsetOut );
84+
gcopy( N1, prepend, strideP, offsetP, obuf, strideOut, offsetOut );
8985

9086
// Compute differences of input array:
9187
ix = offsetX;
@@ -100,7 +96,7 @@ function gediff( N, x, strideX, offsetX, N1, prepend, strideP, offsetP, N2, appe
10096
}
10197

10298
// Copy `append` into output array:
103-
gcopy( N2, append.data, strideA, offsetA, obuf, strideOut, io );
99+
gcopy( N2, append, strideA, offsetA, obuf, strideOut, io );
104100

105101
return out;
106102
}

lib/node_modules/@stdlib/blas/ext/base/gediff/lib/ndarray.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ function gediff( N, x, strideX, offsetX, N1, prepend, strideP, offsetP, N2, appe
6464
var curr;
6565
var ox;
6666
var oo;
67-
var op;
68-
var oa;
6967
var ix;
7068
var io;
7169
var i;
@@ -77,10 +75,8 @@ function gediff( N, x, strideX, offsetX, N1, prepend, strideP, offsetP, N2, appe
7775

7876
ox = arraylike2object( x );
7977
oo = arraylike2object( out );
80-
op = arraylike2object( prepend );
81-
oa = arraylike2object( append );
82-
if ( ox.accessorProtocol || oo.accessorProtocol || op.accessorProtocol || oa.accessorProtocol ) {
83-
accessors( N, ox, strideX, offsetX, N1, op, strideP, offsetP, N2, oa, strideA, offsetA, oo, strideOut, offsetOut );
78+
if ( ox.accessorProtocol || oo.accessorProtocol ) {
79+
accessors( N, ox, strideX, offsetX, N1, prepend, strideP, offsetP, N2, append, strideA, offsetA, oo, strideOut, offsetOut );
8480
return oo.data;
8581
}
8682

0 commit comments

Comments
 (0)