Fix sort for catch all server
This commit is contained in:
parent
8e90fc0290
commit
f893a88f5e
1 changed files with 4 additions and 0 deletions
|
@ -54,6 +54,10 @@ type ServerByName []*Server
|
||||||
func (c ServerByName) Len() int { return len(c) }
|
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) Swap(i, j int) { c[i], c[j] = c[j], c[i] }
|
||||||
func (c ServerByName) Less(i, j int) bool {
|
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
|
return c[i].Hostname < c[j].Hostname
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue