Minor (possible) bug fix

This commit is contained in:
Sergio Pedri
2020-08-06 13:14:06 +02:00
parent c3a327d3a1
commit d3ef8bfb07
@@ -638,9 +638,14 @@ namespace Microsoft.Toolkit.Mvvm.Messaging
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(Type2 other)
{
// We can't just use reference equality, as that's technically not guaranteed
// to work and might fail in very rare cases (eg. with type forwarding between
// different assemblies). Instead, we can use the == operator to compare for
// equality, which still avoids the callvirt overhead of calling Type.Equals,
// and is also implemented as a JIT intrinsic on runtimes such as .NET Core.
return
ReferenceEquals(this.tMessage, other.tMessage) &&
ReferenceEquals(this.tToken, other.tToken);
this.tMessage == other.tMessage &&
this.tToken == other.tToken;
}
/// <inheritdoc/>