sort slice

This commit is contained in:
shoopea
2021-12-05 22:39:14 +08:00
parent 365c8a9f91
commit c3225a79aa
2 changed files with 6 additions and 4 deletions

2
bot.go
View File

@@ -7,6 +7,7 @@ import (
"fmt"
"math"
"regexp"
"sort"
"strconv"
"time"
@@ -929,6 +930,7 @@ func botGraphValue(m *tb.Message) {
}
vals[coID] = append(vals[coID], pt)
}
sort.Slice(vals[coID], func(i, j int) bool { return vals[coID][i].X < vals[coID][j].X })
}
}