Revert "Revert "Audit hashCode overrides outside of packages/flutter (#85370)" (#85451)" (#85567)

This reverts commit 2be0d57fa2.
This commit is contained in:
Dan Field
2021-06-30 09:46:54 -07:00
committed by GitHub
parent ae2442c8c6
commit e36e62e9a6
18 changed files with 30 additions and 68 deletions

View File

@@ -166,15 +166,14 @@ class CommandArgs {
}
@override
int get hashCode => 17 * (17 * command.hashCode + _hashArguments) + _hashEnvironment;
int get _hashArguments => arguments != null
? const ListEquality<String>().hash(arguments)
: null.hashCode;
int get _hashEnvironment => environment != null
? const MapEquality<String, String>().hash(environment)
: null.hashCode;
int get hashCode {
return Object.hash(
command,
Object.hashAll(arguments ?? const <String>[]),
Object.hashAllUnordered(environment?.keys ?? const <String>[]),
Object.hashAllUnordered(environment?.values ?? const <String>[]),
);
}
}
class FakeDevice extends AndroidDevice {