CA-197622: Fixed exception "Unable to sort because the IComparer.Compare() method returns inconsistent results"

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
Mihaela Stoica 2016-02-12 16:19:12 +00:00
parent 12700a638a
commit ac5eda5812

View File

@ -768,10 +768,7 @@ namespace XenAdmin.Controls.CustomDataGraph
if (Uuid == other.Uuid)
return 0;
double disp1 = DisplayArea;
double disp2 = other.DisplayArea;
//attempt some sort of hysteresis type thing to prevent graphs swapping too frequently
int comp = disp1 == disp2 ? 0 : disp1 * 1.1 < disp2 ? -1 : disp1 / 1.1 > disp2 ? 1 : 0;
int comp = DisplayArea.CompareTo(other.DisplayArea);
if (comp == 0)
return StringUtility.NaturalCompare(Name, other.Name);
return comp;