github.com/bytom/bytom@v1.1.2-0.20221014091027-bbcba3df6075/proposal/sort.go (about) 1 package proposal 2 3 import "github.com/bytom/bytom/protocol" 4 5 type byTime []*protocol.TxDesc 6 7 func (a byTime) Len() int { return len(a) } 8 func (a byTime) Swap(i, j int) { a[i], a[j] = a[j], a[i] } 9 func (a byTime) Less(i, j int) bool { return a[i].Added.Before(a[j].Added) }