From 4e45b80f12794352e93bf7abac9ef990c1e8e2fa Mon Sep 17 00:00:00 2001 From: s_falahati Date: Sat, 20 Oct 2018 03:47:32 +0330 Subject: [PATCH] Multiple problems with equality operators fixed --- HeliosDisplayManagement.Shared/NVIDIA/SurroundTopology.cs | 4 ++-- .../NVIDIA/SurroundTopologyDisplay.cs | 4 ++-- HeliosDisplayManagement.Shared/Profile.cs | 4 ++-- HeliosDisplayManagement.Shared/Topology/Path.cs | 4 ++-- HeliosDisplayManagement.Shared/Topology/PathTarget.cs | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/HeliosDisplayManagement.Shared/NVIDIA/SurroundTopology.cs b/HeliosDisplayManagement.Shared/NVIDIA/SurroundTopology.cs index 893cdc6..b5ec284 100644 --- a/HeliosDisplayManagement.Shared/NVIDIA/SurroundTopology.cs +++ b/HeliosDisplayManagement.Shared/NVIDIA/SurroundTopology.cs @@ -112,12 +112,12 @@ namespace HeliosDisplayManagement.Shared.NVIDIA public static bool operator ==(SurroundTopology left, SurroundTopology right) { - return Equals(left, right); + return Equals(left, right) || left?.Equals(right) == true; } public static bool operator !=(SurroundTopology left, SurroundTopology right) { - return !Equals(left, right); + return !(left == right); } /// diff --git a/HeliosDisplayManagement.Shared/NVIDIA/SurroundTopologyDisplay.cs b/HeliosDisplayManagement.Shared/NVIDIA/SurroundTopologyDisplay.cs index 6608b9d..9f6ed21 100644 --- a/HeliosDisplayManagement.Shared/NVIDIA/SurroundTopologyDisplay.cs +++ b/HeliosDisplayManagement.Shared/NVIDIA/SurroundTopologyDisplay.cs @@ -54,12 +54,12 @@ namespace HeliosDisplayManagement.Shared.NVIDIA public static bool operator ==(SurroundTopologyDisplay left, SurroundTopologyDisplay right) { - return Equals(left, right); + return Equals(left, right) || left?.Equals(right) == true; } public static bool operator !=(SurroundTopologyDisplay left, SurroundTopologyDisplay right) { - return !Equals(left, right); + return !(left == right); } /// diff --git a/HeliosDisplayManagement.Shared/Profile.cs b/HeliosDisplayManagement.Shared/Profile.cs index 20dce88..3775428 100644 --- a/HeliosDisplayManagement.Shared/Profile.cs +++ b/HeliosDisplayManagement.Shared/Profile.cs @@ -145,12 +145,12 @@ namespace HeliosDisplayManagement.Shared public static bool operator ==(Profile left, Profile right) { - return Equals(left, right); + return Equals(left, right) || left?.Equals(right) == true; } public static bool operator !=(Profile left, Profile right) { - return !Equals(left, right); + return !(left == right); } public static void RefreshActiveStatus() diff --git a/HeliosDisplayManagement.Shared/Topology/Path.cs b/HeliosDisplayManagement.Shared/Topology/Path.cs index b6c1809..4acccf4 100644 --- a/HeliosDisplayManagement.Shared/Topology/Path.cs +++ b/HeliosDisplayManagement.Shared/Topology/Path.cs @@ -42,12 +42,12 @@ namespace HeliosDisplayManagement.Shared.Topology public static bool operator ==(Path left, Path right) { - return Equals(left, right); + return Equals(left, right) || left?.Equals(right) == true; } public static bool operator !=(Path left, Path right) { - return !Equals(left, right); + return !(left == right); } /// diff --git a/HeliosDisplayManagement.Shared/Topology/PathTarget.cs b/HeliosDisplayManagement.Shared/Topology/PathTarget.cs index 022df55..ba115f5 100644 --- a/HeliosDisplayManagement.Shared/Topology/PathTarget.cs +++ b/HeliosDisplayManagement.Shared/Topology/PathTarget.cs @@ -58,12 +58,12 @@ namespace HeliosDisplayManagement.Shared.Topology public static bool operator ==(PathTarget left, PathTarget right) { - return Equals(left, right); + return Equals(left, right) || left?.Equals(right) == true; } public static bool operator !=(PathTarget left, PathTarget right) { - return !Equals(left, right); + return !(left == right); } ///