aboutsummaryrefslogtreecommitdiff
path: root/bucket.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-03-21 08:45:34 -0600
committerBen Johnson <benbjohnson@yahoo.com>2014-03-21 08:45:34 -0600
commit1c7b59a4c221bde00f84a1873fca7ad0a27b0131 (patch)
tree53a318271e854c56a97d9a8b18c39553802419f7 /bucket.go
parentFix Bucket.ForEach() comment. (diff)
parentFix Tx.Buckets() sort order. (diff)
downloaddedo-1c7b59a4c221bde00f84a1873fca7ad0a27b0131.tar.gz
dedo-1c7b59a4c221bde00f84a1873fca7ad0a27b0131.tar.xz
Merge pull request #65 from benbjohnson/fix-tx-buckets-sort-order
Fix Tx.Buckets() sort order.
Diffstat (limited to 'bucket.go')
-rw-r--r--bucket.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/bucket.go b/bucket.go
index 3e3392c..dbd06f1 100644
--- a/bucket.go
+++ b/bucket.go
@@ -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 }