From 114f651d1f29cc711adf2990a10d56470650af48 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Sun, 8 Sep 2024 18:40:19 -0700 Subject: [PATCH] refactor: use base array assertion utility --- .../base/assert/has-equal-shape/lib/main.js | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/node_modules/@stdlib/ndarray/base/assert/has-equal-shape/lib/main.js b/lib/node_modules/@stdlib/ndarray/base/assert/has-equal-shape/lib/main.js index cb975aa74b7..6f07a8adc45 100644 --- a/lib/node_modules/@stdlib/ndarray/base/assert/has-equal-shape/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/base/assert/has-equal-shape/lib/main.js @@ -21,6 +21,7 @@ // MODULES // var shape = require( '@stdlib/ndarray/base/shape' ); +var hasEqualValuesIndexed = require( '@stdlib/array/base/assert/has-equal-values-indexed' ); // MAIN // @@ -42,21 +43,7 @@ var shape = require( '@stdlib/ndarray/base/shape' ); * // returns true */ function hasEqualShape( x, y ) { - var xsh; - var ysh; - var i; - - xsh = shape( x, false ); - ysh = shape( y, false ); - if ( xsh.length !== ysh.length ) { - return false; - } - for ( i = 0; i < xsh.length; i++ ) { - if ( xsh[ i ] !== ysh[ i ] ) { - return false; - } - } - return true; + return hasEqualValuesIndexed( shape( x, false ), shape( y, false ) ); }