Fix sort for catch all server

This commit is contained in:
Manuel de Brito Fontes 2016-12-29 12:29:39 -03:00
parent 8e90fc0290
commit f893a88f5e

View file

@ -54,6 +54,10 @@ type ServerByName []*Server
func (c ServerByName) Len() int { return len(c) }
func (c ServerByName) Swap(i, j int) { c[i], c[j] = c[j], c[i] }
func (c ServerByName) Less(i, j int) bool {
// special case for catch all server
if c[j].Hostname == "_" {
return false
}
return c[i].Hostname < c[j].Hostname
}