mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
Express records.Less more clearly.
This commit is contained in:
parent
fed11184c7
commit
6e0e5f9137
1 changed files with 1 additions and 4 deletions
|
@ -34,10 +34,7 @@ type records []record
|
|||
func (r records) Len() int { return len(r) }
|
||||
func (r records) Swap(i, j int) { r[i], r[j] = r[j], r[i] }
|
||||
func (r records) Less(i, j int) bool {
|
||||
if r[i].count == r[j].count {
|
||||
return r[i].cc < r[j].cc
|
||||
}
|
||||
return r[i].count > r[j].count
|
||||
return r[i].count > r[j].count || (r[i].count == r[j].count && r[i].cc < r[j].cc)
|
||||
}
|
||||
|
||||
type Metrics struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue