diff options
author | Thanos Apollo <[email protected]> | 2024-07-21 16:03:19 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-07-21 16:03:19 +0300 |
commit | 00adb72afc14021909ecad668fbba892ebf5e03a (patch) | |
tree | a1ded044ef3e75b2de9d1bff108e08afc44fb933 /gnosis.el | |
parent | edcd36b912009573307446b5ce97b77fff955fff (diff) |
review: Get unsuspended due notes directly with emacsql
* Improve performance.
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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))) |