From 73a9c0a2be6ab5d9381b16825cffd76199b8dee1 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Fri, 24 Nov 2017 12:59:14 +0100 Subject: [PATCH] Fix: Sorting was unstable Signed-off-by: Knut Ahlers --- structs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/structs.go b/structs.go index 5fb03ef..82f097d 100644 --- a/structs.go +++ b/structs.go @@ -50,7 +50,7 @@ type dashboardMetrics []*dashboardMetric func (a dashboardMetrics) Len() int { return len(a) } func (a dashboardMetrics) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a dashboardMetrics) Less(i, j int) bool { - return a[i].HistoricalData[0].Time.Before(a[j].HistoricalData[0].Time) + return a[i].Meta.LastUpdate.Before(a[j].Meta.LastUpdate) } type dashboardMetric struct {