From ebe0a8148af336b582a0e16f4a26856210c3d59d Mon Sep 17 00:00:00 2001 From: Azat Ibrakov Date: Sun, 9 Jul 2023 02:47:23 +0200 Subject: [PATCH] Fix errors --- src/Fractions/mod.cs | 6 +++--- src/Gon/point.cs | 4 ++-- src/Gon/segment.cs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Fractions/mod.cs b/src/Fractions/mod.cs index 04713aa..957775b 100644 --- a/src/Fractions/mod.cs +++ b/src/Fractions/mod.cs @@ -45,7 +45,7 @@ public Fraction(BigInteger numerator, BigInteger denominator) public static bool operator >(Fraction self, Fraction other) => self.CompareTo(other) > 0; - public bool Equals(Fraction other) + public bool Equals(Fraction? other) { if (ReferenceEquals(other, null)) return false; @@ -54,7 +54,7 @@ public bool Equals(Fraction other) return numerator.Equals(other.numerator) && denominator.Equals(other.denominator); } - public override bool Equals(object other) => Equals(other as Fraction); + public override bool Equals(object? other) => Equals(other as Fraction); public override int GetHashCode() { @@ -75,7 +75,7 @@ public override int GetHashCode() return numerator < BigInteger.Zero ? -result : result; } - public int CompareTo(Fraction other) + public int CompareTo(Fraction? other) { return ReferenceEquals(other, null) ? 1 diff --git a/src/Gon/point.cs b/src/Gon/point.cs index 8dec1ad..dc79305 100644 --- a/src/Gon/point.cs +++ b/src/Gon/point.cs @@ -47,7 +47,7 @@ public Point(Scalar x, Scalar y) public static bool operator !=(Point self, Point other) => !(self == other); - public bool Equals(Point other) + public bool Equals(Point? other) { if (ReferenceEquals(other, null)) return false; @@ -56,7 +56,7 @@ public bool Equals(Point other) return x.Equals(other.x) && y.Equals(other.y); } - public override bool Equals(object other) => Equals(other as Point); + public override bool Equals(object? other) => Equals(other as Point); public override int GetHashCode() => (x, y).GetHashCode(); } diff --git a/src/Gon/segment.cs b/src/Gon/segment.cs index 1b84eea..a5f435f 100644 --- a/src/Gon/segment.cs +++ b/src/Gon/segment.cs @@ -24,7 +24,7 @@ public Segment(Point start, Point end) public static bool operator !=(Segment self, Segment other) => !(self == other); - public bool Equals(Segment other) + public bool Equals(Segment? other) { if (ReferenceEquals(other, null)) return false; @@ -34,7 +34,7 @@ public bool Equals(Segment other) || start.Equals(other.end) && end.Equals(other.start); } - public override bool Equals(object other) => Equals(other as Segment); + public override bool Equals(object? other) => Equals(other as Segment); public override int GetHashCode() => (start, end).GetHashCode(); }