mirror of https://github.com/etcd-io/bbolt.git
Merge pull request #65 from benbjohnson/fix-tx-buckets-sort-order
Fix Tx.Buckets() sort order.pull/34/head
commit
1c7b59a4c2
|
@ -155,3 +155,9 @@ type BucketStat struct {
|
|||
KeyCount int
|
||||
MaxDepth int
|
||||
}
|
||||
|
||||
type bucketsByName []*Bucket
|
||||
|
||||
func (s bucketsByName) Len() int { return len(s) }
|
||||
func (s bucketsByName) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
||||
func (s bucketsByName) Less(i, j int) bool { return s[i].name < s[j].name }
|
||||
|
|
Loading…
Reference in New Issue