Skip to content

Commit 5de66cc

Browse files
fishythefishCommit Queue
authored andcommitted
[dart2js] Make some operator == use just identical.
b/384749454 demonstrates that defining `operator ==` to agree with `hashCode` can cause some problematic semantic differences. Although we haven't seen issues coming from these classes, this removes the new semantics for `HBasicBlock` and `ValueSetNode`. Change-Id: Ieb46f3ea2ab136cf990b6d8ec38f62977eddf547 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401386 Commit-Queue: Nate Biggs <[email protected]> Auto-Submit: Mayank Patke <[email protected]> Reviewed-by: Nate Biggs <[email protected]>
1 parent 4c4fb56 commit 5de66cc

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

pkg/compiler/lib/src/ssa/nodes.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -826,8 +826,7 @@ class HBasicBlock extends HInstructionList {
826826
int get hashCode => id;
827827

828828
@override
829-
bool operator ==(other) =>
830-
identical(this, other) || other is HBasicBlock && id == other.id;
829+
bool operator ==(other) => identical(this, other);
831830

832831
bool get isNew => _status == _BasicBlockStatus.new_;
833832
bool get isOpen => _status == _BasicBlockStatus.open;

pkg/compiler/lib/src/ssa/value_set.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,5 @@ class ValueSetNode {
169169
ValueSetNode(this.value, this.hash, this.next);
170170

171171
@override
172-
bool operator ==(other) =>
173-
identical(this, other) || other is ValueSetNode && hash == other.hash;
172+
bool operator ==(other) => identical(this, other);
174173
}

0 commit comments

Comments
 (0)