From a970a21078a40f312a217fc44cbf383bc23425d5 Mon Sep 17 00:00:00 2001 From: Archomeda Date: Mon, 24 Feb 2020 21:01:09 +0100 Subject: [PATCH] Fix the last thing that SonarCloud regards as a bug --- Gw2Sharp/WebApi/V2/Models/Rectangle.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Gw2Sharp/WebApi/V2/Models/Rectangle.cs b/Gw2Sharp/WebApi/V2/Models/Rectangle.cs index fc64bd93b..2c0fe0de6 100644 --- a/Gw2Sharp/WebApi/V2/Models/Rectangle.cs +++ b/Gw2Sharp/WebApi/V2/Models/Rectangle.cs @@ -109,12 +109,15 @@ public bool Equals(Rectangle other) /// public override int GetHashCode() { - int hashCode = -505697310; - hashCode = (hashCode * -1521134295) + EqualityComparer.Default.GetHashCode(this.TopLeft); - hashCode = (hashCode * -1521134295) + EqualityComparer.Default.GetHashCode(this.TopRight); - hashCode = (hashCode * -1521134295) + EqualityComparer.Default.GetHashCode(this.BottomLeft); - hashCode = (hashCode * -1521134295) + EqualityComparer.Default.GetHashCode(this.BottomRight); - return hashCode; + unchecked + { + int hashCode = -505697310; + hashCode = (hashCode * -1521134295) + EqualityComparer.Default.GetHashCode(this.TopLeft); + hashCode = (hashCode * -1521134295) + EqualityComparer.Default.GetHashCode(this.TopRight); + hashCode = (hashCode * -1521134295) + EqualityComparer.Default.GetHashCode(this.BottomLeft); + hashCode = (hashCode * -1521134295) + EqualityComparer.Default.GetHashCode(this.BottomRight); + return hashCode; + } } ///