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

This commit is contained in:
Dan Field
2021-06-26 17:36:04 -07:00
committed by GitHub
parent a85811ac6c
commit 9846fa5145
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 {