summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-11-02 00:08:41 -0700
committerSteve Manuel <nilslice@gmail.com>2016-11-02 00:08:41 -0700
commit01040a704ebf4ba3e856c1e18e0bb8487776ed65 (patch)
treec984fec310ab891d9a41a547a2419b9d8f90e9fd
parentfe3e580e05cdbe1b7794f8c5f61634654377433b (diff)
adding addtional stops for count/offset
-rw-r--r--system/db/content.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/system/db/content.go b/system/db/content.go
index f1969b5..3e22a68 100644
--- a/system/db/content.go
+++ b/system/db/content.go
@@ -246,12 +246,17 @@ func Query(namespace string, opts QueryOptions) [][]byte {
continue
}
+ if cur >= start {
+ break
+ }
+
if i >= opts.Count {
break
}
posts = append(posts, v)
i++
+ cur++
}
case "desc":
@@ -261,12 +266,17 @@ func Query(namespace string, opts QueryOptions) [][]byte {
continue
}
+ if cur >= end {
+ break
+ }
+
if i >= opts.Count {
break
}
posts = append(posts, v)
i++
+ cur++
}
}