This reverts commit 9846fa5145.
This commit is contained in:
@@ -28,7 +28,20 @@ class RunningProcessInfo {
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(pid, commandLine, creationDate);
|
||||
int get hashCode {
|
||||
// TODO(dnfield): Replace this when Object.hashValues lands, https://github.com/dart-lang/sdk/issues/11617
|
||||
int hash = 17;
|
||||
if (pid != null) {
|
||||
hash = hash * 23 + pid.hashCode;
|
||||
}
|
||||
if (commandLine != null) {
|
||||
hash = hash * 23 + commandLine.hashCode;
|
||||
}
|
||||
if (creationDate != null) {
|
||||
hash = hash * 23 + creationDate.hashCode;
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user