summaryrefslogtreecommitdiff
path: root/system/db/content.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2017-04-03 17:04:19 -0700
committerSteve Manuel <nilslice@gmail.com>2017-04-03 17:04:19 -0700
commitced1f00064bfdaf71125817dcc0a18f7f07124e9 (patch)
tree92d9261fb31bf8a363e977966f85a75887e81d1d /system/db/content.go
parentfaf4c67abcc5211e7b5ff45e908fa8a787bdaff2 (diff)
swap asc/desc now that natural order in db is changed
Diffstat (limited to 'system/db/content.go')
-rw-r--r--system/db/content.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/system/db/content.go b/system/db/content.go
index 4de9342..97ea9b4 100644
--- a/system/db/content.go
+++ b/system/db/content.go
@@ -459,7 +459,7 @@ func Query(namespace string, opts QueryOptions) (int, [][]byte) {
i := 0 // count of num posts added
cur := 0 // count of num cursor moves
switch opts.Order {
- case "asc":
+ case "desc", "":
for k, v := c.Last(); k != nil; k, v = c.Prev() {
if cur < start {
cur++
@@ -475,7 +475,7 @@ func Query(namespace string, opts QueryOptions) (int, [][]byte) {
cur++
}
- case "desc", "":
+ case "asc":
for k, v := c.First(); k != nil; k, v = c.Next() {
if cur < start {
cur++
@@ -493,7 +493,7 @@ func Query(namespace string, opts QueryOptions) (int, [][]byte) {
default:
// results for DESC order
- for k, v := c.First(); k != nil; k, v = c.Next() {
+ for k, v := c.Last(); k != nil; k, v = c.Prev() {
if cur < start {
cur++
continue