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

This reverts commit 9846fa5145.
This commit is contained in:
Ren You
2021-06-28 09:55:31 -07:00
committed by GitHub
parent d586873275
commit 2be0d57fa2
18 changed files with 68 additions and 30 deletions

View File

@@ -166,14 +166,15 @@ class CommandArgs {
}
@override
int get hashCode {
return Object.hash(
command,
Object.hashAll(arguments ?? const <String>[]),
Object.hashAllUnordered(environment?.keys ?? const <String>[]),
Object.hashAllUnordered(environment?.values ?? const <String>[]),
);
}
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;
}
class FakeDevice extends AndroidDevice {