File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1107,10 +1107,14 @@ export abstract class TypeNode extends Node {
1107
1107
abstract equals ( node : TypeNode ) : bool ;
1108
1108
1109
1109
static arrayEquals ( node : Comparable [ ] | null , other : Comparable [ ] | null ) : bool {
1110
- if ( node == null && other == null ) return true ;
1111
- if ( node == null || other == null ) return false ;
1112
- if ( node . length != other . length ) return false ;
1113
- return node . map ( ( value , i ) => value . equals ( other [ i ] ) ) . every ( x => x ) ;
1110
+ if ( node == other ) return true ;
1111
+ if ( ! node || ! other ) return false ;
1112
+ const len = other . length ;
1113
+ if ( node . length !== len ) return false ;
1114
+ for ( let i = 0 ; i < len ; i ++ ) {
1115
+ if ( ! node [ i ] . equals ( other [ i ] ) ) return false ;
1116
+ }
1117
+ return true ;
1114
1118
}
1115
1119
}
1116
1120
You can’t perform that action at this time.
0 commit comments