Skip to content
This repository was archived by the owner on Aug 8, 2022. It is now read-only.

Commit 2ac662a

Browse files
committed
fix(ScaleSet): use === for eq
1 parent cea81c5 commit 2ac662a

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

assembly/ScaleSet.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,26 +56,16 @@ export class ScaleSet<T extends Codec>
5656
}
5757

5858
@operator("==")
59-
eq(other: ScaleSet<T>): bool {
60-
const aLen = this.size;
61-
const bLen = other.size;
62-
const aValues = this.values();
63-
const bValues = other.values();
64-
65-
if (aLen != bLen) {
66-
return false;
67-
}
68-
for (let i = 0; i < aValues.length; i++) {
69-
if (aValues[i] != bValues[i]) {
70-
return false;
71-
}
59+
eq(other: this): bool {
60+
if (this === other) {
61+
return true;
7262
}
73-
return true;
63+
return false;
7464
}
7565

7666
@operator("!=")
77-
notEq(other: ScaleSet<T>): bool {
78-
return !this.eq(other);
67+
notEq(other: this): bool {
68+
return !this.eq(this);
7969
}
8070

8171
static fromU8a<T extends Codec>(input: u8[], index: i32 = 0): ScaleSet<T> {

0 commit comments

Comments
 (0)