From 0db89cdb67a07c7da3559de2aa6f369b03bce432 Mon Sep 17 00:00:00 2001 From: mark Date: Wed, 21 Jun 2006 01:35:52 +0000 Subject: [PATCH] generic comparer --- Scripts/Skills/Tracking.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Scripts/Skills/Tracking.cs b/Scripts/Skills/Tracking.cs index 6db6b8c2f..5864ca6cd 100644 --- a/Scripts/Skills/Tracking.cs +++ b/Scripts/Skills/Tracking.cs @@ -127,7 +127,7 @@ namespace Server.SkillHandlers new TrackTypeDelegate( IsPlayer ) }; - private class InternalSorter : IComparer + private class InternalSorter : IComparer { private Mobile m_From; @@ -136,7 +136,7 @@ namespace Server.SkillHandlers m_From = from; } - public int Compare( object x, object y ) + public int Compare( Mobile x, Mobile y ) { if ( x == null && y == null ) return 0; @@ -145,13 +145,7 @@ namespace Server.SkillHandlers else if ( y == null ) return 1; - Mobile a = x as Mobile; - Mobile b = y as Mobile; - - if ( a == null || b == null ) - throw new ArgumentException(); - - return m_From.GetDistanceToSqrt( a ).CompareTo( m_From.GetDistanceToSqrt( b ) ); + return m_From.GetDistanceToSqrt( x ).CompareTo( m_From.GetDistanceToSqrt( y ) ); } }