summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-07-21 16:03:19 +0300
committerThanos Apollo <[email protected]>2024-07-21 16:03:19 +0300
commit00adb72afc14021909ecad668fbba892ebf5e03a (patch)
treea1ded044ef3e75b2de9d1bff108e08afc44fb933 /gnosis.el
parentedcd36b912009573307446b5ce97b77fff955fff (diff)
review: Get unsuspended due notes directly with emacsql
* Improve performance.
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/gnosis.el b/gnosis.el
index bee4d15..81907a4 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1386,11 +1386,15 @@ well."
(defun gnosis-review-get-due-notes ()
"Return a list due notes id for current date."
- (let* ((old-notes (cl-loop for note in (gnosis-select 'id 'review-log '(> n 0) t)
+ (let* ((old-notes (cl-loop for note in (gnosis-select 'id 'review-log '(and (> n 0)
+ (= suspend 0))
+ t)
when (gnosis-review-is-due-p note)
collect note))
- (new-notes (cl-loop for note in (gnosis-select 'id 'review-log '(= n 0) t)
- when (gnosis-review-is-due-p note)
+ (new-notes (cl-loop for note in (gnosis-select 'id 'review-log '(and (= n 0)
+ (= suspend 0))
+ t)
+ when (gnosis-review-is-due-today-p note)
collect note)))
(append (cl-subseq new-notes 0 gnosis-new-notes-limit) old-notes)))