branch: elpa/gnosis
commit 7a41e6c44d27fce0ef81a2e8d32e24e121d99248
Author: Thanos Apollo <[email protected]>
Commit: Thanos Apollo <[email protected]>

    dashboard-mark-toggle: Use cons instead of append.
    
    + Use O(N) instead of O(1) as suggested by Stefan Monnier.
      + append requires traversing the entire list, while cons does not.
---
 gnosis.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnosis.el b/gnosis.el
index b1957b90e80..ba1fb126956 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -2784,7 +2784,7 @@ DASHBOARD-TYPE: either Notes or Decks to display the 
respective dashboard."
             (let ((ov (make-overlay beg end)))
              (unless (member id gnosis-dashboard--selected-ids)
                (setf gnosis-dashboard--selected-ids
-                     (append gnosis-dashboard--selected-ids (list id))))
+                     (cons id gnosis-dashboard--selected-ids)))
               (overlay-put ov 'face 'highlight)
               (overlay-put ov 'gnosis-mark t)))
          (forward-line))

Reply via email to