Remove extra hashCode in Object.hash().

Change-Id: Ifad348ae035dd69764c3264b7ddfd8036bc1dc54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216763
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
Konstantin Shcheglov 2021-10-14 15:20:12 +00:00 committed by commit-bot@chromium.org
parent fa50b7e5d1
commit 7e717e3ff7
5 changed files with 10 additions and 10 deletions

View file

@ -22,7 +22,7 @@ class ClassMemberReference {
final int hashCode;
ClassMemberReference(this.target, this.name)
: hashCode = Object.hash(target.hashCode, name.hashCode);
: hashCode = Object.hash(target, name);
@override
bool operator ==(Object other) {
@ -120,7 +120,7 @@ class LibraryQualifiedName {
factory LibraryQualifiedName(Uri libraryUri, String name) {
var isPrivate = name.startsWith('_');
var hashCode = Object.hash(libraryUri.hashCode, name.hashCode);
var hashCode = Object.hash(libraryUri, name);
return LibraryQualifiedName._internal(
libraryUri, name, isPrivate, hashCode);
}

View file

@ -184,7 +184,7 @@ class DartObjectImpl implements DartObject {
Map<String, DartObjectImpl>? get fields => _state.fields;
@override
int get hashCode => Object.hash(type.hashCode, _state.hashCode);
int get hashCode => Object.hash(type, _state);
@override
bool get hasKnownValue => !_state.isUnknown;

View file

@ -884,7 +884,7 @@ class Name {
factory Name(Uri? libraryUri, String name) {
if (name.startsWith('_')) {
var hashCode = Object.hash(libraryUri.hashCode, name.hashCode);
var hashCode = Object.hash(libraryUri, name);
return Name._internal(libraryUri, name, false, hashCode);
} else {
return Name._internal(null, name, true, name.hashCode);

View file

@ -51,7 +51,7 @@ class _FixReasonTarget_NamedParameter extends _FixReasonTarget_Part {
: super(inner);
@override
int get hashCode => Object.hash(2, inner.hashCode, name.hashCode);
int get hashCode => Object.hash(2, inner, name);
@override
bool operator ==(Object other) =>
@ -80,7 +80,7 @@ class _FixReasonTarget_PositionalParameter extends _FixReasonTarget_Part {
: super(inner);
@override
int get hashCode => Object.hash(1, inner.hashCode, index);
int get hashCode => Object.hash(1, inner, index);
@override
bool operator ==(Object other) =>
@ -98,7 +98,7 @@ class _FixReasonTarget_ReturnType extends _FixReasonTarget_Part {
_FixReasonTarget_ReturnType(FixReasonTarget inner) : super(inner);
@override
int get hashCode => Object.hash(3, inner.hashCode);
int get hashCode => Object.hash(3, inner);
@override
bool operator ==(Object other) =>
@ -131,7 +131,7 @@ class _FixReasonTarget_TypeArgument extends _FixReasonTarget_Part {
: super(inner);
@override
int get hashCode => Object.hash(5, inner.hashCode, index);
int get hashCode => Object.hash(5, inner, index);
@override
bool operator ==(Object other) =>
@ -162,7 +162,7 @@ class _FixReasonTarget_YieldedType extends _FixReasonTarget_Part {
_FixReasonTarget_YieldedType(FixReasonTarget inner) : super(inner);
@override
int get hashCode => Object.hash(4, inner.hashCode);
int get hashCode => Object.hash(4, inner);
@override
bool operator ==(Object other) =>

View file

@ -142,7 +142,7 @@ class NavigationTarget extends NavigationRegion {
: super(offset, line, length);
@override
int get hashCode => Object.hash(filePath.hashCode, offset, length);
int get hashCode => Object.hash(filePath, offset, length);
@override
bool operator ==(Object other) {