Skip to content

Commit 0832322

Browse files
committed
Cleanup
1 parent f9f13c3 commit 0832322

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Main/src/Ranges/[Boundaries]/RangeBoundaryFrom`1.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -517,17 +517,16 @@ public int CompareTo(T other) =>
517517
[Pure]
518518
int IComparable.CompareTo(object obj)
519519
{
520-
// ReSharper disable once UsePatternMatching
521-
var otherA = obj as RangeBoundaryFrom<T>?;
522-
if (otherA != null)
520+
// ReSharper disable once MergeCastWithTypeCheck
521+
if (obj is RangeBoundaryFrom<T>)
523522
{
524-
return CompareTo(otherA.GetValueOrDefault());
523+
return CompareTo((RangeBoundaryFrom<T>)obj);
525524
}
526-
// ReSharper disable once UsePatternMatching
527-
var otherB = obj as RangeBoundaryTo<T>?;
528-
if (otherB != null)
525+
526+
// ReSharper disable once MergeCastWithTypeCheck
527+
if (obj is RangeBoundaryTo<T>)
529528
{
530-
return CompareTo(otherB.GetValueOrDefault());
529+
return CompareTo((RangeBoundaryTo<T>)obj);
531530
}
532531

533532
return CompareTo((T)obj);

0 commit comments

Comments
 (0)