Skip to content

Commit

Permalink
Fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lycantropos committed Jul 9, 2023
1 parent 50bf0d1 commit ebe0a81
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/Fractions/mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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()
{
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Gon/point.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public Point(Scalar x, Scalar y)

public static bool operator !=(Point<Scalar> self, Point<Scalar> other) => !(self == other);

public bool Equals(Point<Scalar> other)
public bool Equals(Point<Scalar>? other)
{
if (ReferenceEquals(other, null))
return false;
Expand All @@ -56,7 +56,7 @@ public bool Equals(Point<Scalar> other)
return x.Equals(other.x) && y.Equals(other.y);
}

public override bool Equals(object other) => Equals(other as Point<Scalar>);
public override bool Equals(object? other) => Equals(other as Point<Scalar>);

public override int GetHashCode() => (x, y).GetHashCode();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Gon/segment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public Segment(Point<Scalar> start, Point<Scalar> end)
public static bool operator !=(Segment<Scalar> self, Segment<Scalar> other) =>
!(self == other);

public bool Equals(Segment<Scalar> other)
public bool Equals(Segment<Scalar>? other)
{
if (ReferenceEquals(other, null))
return false;
Expand All @@ -34,7 +34,7 @@ public bool Equals(Segment<Scalar> other)
|| start.Equals(other.end) && end.Equals(other.start);
}

public override bool Equals(object other) => Equals(other as Segment<Scalar>);
public override bool Equals(object? other) => Equals(other as Segment<Scalar>);

public override int GetHashCode() => (start, end).GetHashCode();
}
Expand Down

0 comments on commit ebe0a81

Please sign in to comment.