File tree Expand file tree Collapse file tree 1 file changed +2
-15
lines changed
lib/node_modules/@stdlib/ndarray/base/assert/has-equal-shape/lib Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Original file line number Diff line number Diff line change 21
21
// MODULES //
22
22
23
23
var shape = require ( '@stdlib/ndarray/base/shape' ) ;
24
+ var hasEqualValuesIndexed = require ( '@stdlib/array/base/assert/has-equal-values-indexed' ) ;
24
25
25
26
26
27
// MAIN //
@@ -42,21 +43,7 @@ var shape = require( '@stdlib/ndarray/base/shape' );
42
43
* // returns true
43
44
*/
44
45
function hasEqualShape ( x , y ) {
45
- var xsh ;
46
- var ysh ;
47
- var i ;
48
-
49
- xsh = shape ( x , false ) ;
50
- ysh = shape ( y , false ) ;
51
- if ( xsh . length !== ysh . length ) {
52
- return false ;
53
- }
54
- for ( i = 0 ; i < xsh . length ; i ++ ) {
55
- if ( xsh [ i ] !== ysh [ i ] ) {
56
- return false ;
57
- }
58
- }
59
- return true ;
46
+ return hasEqualValuesIndexed ( shape ( x , false ) , shape ( y , false ) ) ;
60
47
}
61
48
62
49
You can’t perform that action at this time.
0 commit comments