dm/ud
1
0
forked from sm/ud

fixed bug in sorting

This commit is contained in:
Stephen McQuay 2015-01-24 02:15:17 -08:00
parent ca399c05b7
commit 0da80226c0

View File

@ -39,7 +39,7 @@ func (bv ByVotes) Swap(i, j int) {
bv[i], bv[j] = bv[j], bv[i]
}
func (bv ByVotes) Less(i, j int) bool {
return math.Abs(float64(bv[i].Up-bv[i].Down)) > math.Abs(float64(bv[j].Up-bv[j].Down))
return float64(bv[i].Up-bv[i].Down) > float64(bv[j].Up-bv[j].Down)
}
func main() {