1
0
Fork 0
mirror of https://github.com/Luzifer/mondash.git synced 2024-12-23 04:21:18 +00:00

Fix: Sorting was unstable

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2017-11-24 12:59:14 +01:00
parent f4b32fb17c
commit 73a9c0a2be
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -50,7 +50,7 @@ type dashboardMetrics []*dashboardMetric
func (a dashboardMetrics) Len() int { return len(a) } 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) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a dashboardMetrics) Less(i, j int) bool { 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 { type dashboardMetric struct {