mirror of https://github.com/etcd-io/bbolt.git
Fix Tx.Buckets() sort order.
@tv42 reported an issue with bucket names returning incorrectly. Not sure if this fixes the issue but it is necessary anyway.pull/34/head
parent
fdd7f2162e
commit
62cf02e21a
|
@ -154,3 +154,9 @@ type BucketStat struct {
|
||||||
KeyCount int
|
KeyCount int
|
||||||
MaxDepth 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