We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 34cdf22 commit aa7c1f7Copy full SHA for aa7c1f7
src/ast.ts
@@ -1107,10 +1107,14 @@ export abstract class TypeNode extends Node {
1107
abstract equals(node: TypeNode): bool;
1108
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);
+ if (node == other) return true;
+ if (!node || !other) return false;
+ const len = other.length;
+ 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;
1118
}
1119
1120
0 commit comments