♻️ Refactor av data structure

This commit is contained in:
Daniel 2023-07-13 09:37:52 +08:00
parent 96530382f2
commit dfa561c62c
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 30 additions and 0 deletions

View file

@ -267,6 +267,10 @@ func (table *Table) GetID() string {
}
func (table *Table) SortRows() {
sort.Slice(table.Rows, func(i, j int) bool { return table.Rows[i].ID < table.Rows[j].ID })
// sort by row ids
if 1 > len(table.Sorts) {
return
}