From d8368b5f5eda5553faf5645efc21680e7ee5cdc5 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 6 Jul 2026 13:19:51 +0000 Subject: [PATCH] refactor: avoid unnecessary assignment in `blas/ext/base/{d,s}last-index-of` Propagates refactor from 3ceff10 ("refactor: avoid unnecessary assignment") to sibling last-index-of packages, collapsing the redundant `idx = N - 1 - idx; return idx;` sequence into a single return. --- .../@stdlib/blas/ext/base/dlast-index-of/lib/ndarray.js | 3 +-- .../@stdlib/blas/ext/base/slast-index-of/lib/ndarray.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/lib/ndarray.js index 82bdac9c0131..c56004585907 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dlast-index-of/lib/ndarray.js @@ -58,8 +58,7 @@ function dlastIndexOf( N, searchElement, x, strideX, offsetX ) { return idx; } // Convert the index from reversed "view" to an index in the original "view": - idx = N - 1 - idx; - return idx; + return N - 1 - idx; } diff --git a/lib/node_modules/@stdlib/blas/ext/base/slast-index-of/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/slast-index-of/lib/ndarray.js index 6821b123f546..af1a3c21adc4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/slast-index-of/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/slast-index-of/lib/ndarray.js @@ -58,8 +58,7 @@ function slastIndexOf( N, searchElement, x, strideX, offsetX ) { return idx; } // Convert the index from reversed "view" to an index in the original "view": - idx = N - 1 - idx; - return idx; + return N - 1 - idx; }