diff --git a/src/core/Akka.Remote/RemoteActorRefProvider.cs b/src/core/Akka.Remote/RemoteActorRefProvider.cs index 0649dff960a..9014b35857f 100644 --- a/src/core/Akka.Remote/RemoteActorRefProvider.cs +++ b/src/core/Akka.Remote/RemoteActorRefProvider.cs @@ -435,7 +435,7 @@ public Deploy LookUpRemotes(IEnumerable p) public bool HasAddress(Address address) { - return address == _local.RootPath.Address || address == RootPath.Address || Transport.Addresses.Any(a => a == address); + return address.Equals(_local.RootPath.Address) || address.Equals(RootPath.Address) || Transport.Addresses.Contains(address); } /// diff --git a/src/core/Akka/Actor/Address.cs b/src/core/Akka/Actor/Address.cs index 8ff18069456..81398855cc6 100644 --- a/src/core/Akka/Actor/Address.cs +++ b/src/core/Akka/Actor/Address.cs @@ -10,6 +10,7 @@ using System.Diagnostics; using System.Linq; using System.Text; +using System.Xml.Xsl; using Akka.Util; namespace Akka.Actor @@ -154,7 +155,7 @@ public bool Equals(Address other) } /// - public override bool Equals(object obj) => obj is Address && Equals((Address)obj); + public override bool Equals(object obj) => Equals(obj as Address); /// public override int GetHashCode() @@ -245,7 +246,7 @@ public Address WithPort(int? port = null) /// true if both addresses are equal; otherwise false public static bool operator ==(Address left, Address right) { - return Equals(left, right); + return left?.Equals(right) ?? ReferenceEquals(right, null); } /// @@ -256,7 +257,7 @@ public Address WithPort(int? port = null) /// true if both addresses are not equal; otherwise false public static bool operator !=(Address left, Address right) { - return !Equals(left, right); + return !(left == right); } ///