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

Commit

Permalink
fix(ScaleSet): use === for eq
Browse files Browse the repository at this point in the history
  • Loading branch information
yjhmelody committed May 8, 2021
1 parent cea81c5 commit a0e2b90
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions assembly/ScaleSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,13 @@ export class ScaleSet<T extends Codec>
}

@operator("==")
eq(other: ScaleSet<T>): bool {
const aLen = this.size;
const bLen = other.size;
const aValues = this.values();
const bValues = other.values();

if (aLen != bLen) {
return false;
}
for (let i = 0; i < aValues.length; i++) {
if (aValues[i] != bValues[i]) {
return false;
}
}
return true;
eq(other: this): bool {
return this === other;
}

@operator("!=")
notEq(other: ScaleSet<T>): bool {
return !this.eq(other);
notEq(other: this): bool {
return !this.eq(this);
}

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

0 comments on commit a0e2b90

Please sign in to comment.