Skip to content

Commit 9a763a7

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

File tree

1 file changed

+2
-4
lines changed
  • lib/node_modules/@stdlib/blas/ext/base/ddiff/lib

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,9 @@ function ddiff( N, k, x, strideX, offsetX, N1, prepend, strideP, offsetP, N2, ap
7373
var i;
7474

7575
total = N + N1 + N2;
76-
if ( total <= 1 ) {
77-
return out;
78-
}
76+
7977
// If `k` is greater than or equal to the total number of elements, the k-th forward difference results in an empty array, so this function is a no-op...
80-
if ( k >= total ) {
78+
if ( total <= 1 || k >= total ) {
8179
return out;
8280
}
8381
// If `k` is equal to zero, there are no differences to compute, so we merely copy the various arrays into the output array...

0 commit comments

Comments
 (0)