emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 6ad65f3332: org-agenda-prepare-buffers: Avoid quadr


From: ELPA Syncer
Subject: [elpa] externals/org 6ad65f3332: org-agenda-prepare-buffers: Avoid quadratic complexity when merging tags
Date: Sat, 13 Aug 2022 04:57:44 -0400 (EDT)

branch: externals/org
commit 6ad65f3332937dee81b1a7dc56a6dca7bd4865ae
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>

    org-agenda-prepare-buffers: Avoid quadratic complexity when merging tags
    
    * lisp/org.el (org-agenda-prepare-buffers): Use the shortest list as
    the first argument in `org--tag-add-to-alist'.
    
    `org--tag-add-to-alist' is looping over the first argument.  When we
    use the accumulated tags as the first argument, each buffer tag will
    need to be looped over N_buffers/2 times on average, creating
    quadratic complexity.  Avoid this.
    
    Reported in 
https://orgmode.org/list/62f66552.050a0220.ed346.ac05SMTPIN_ADDED_BROKEN@mx.google.com
---
 lisp/org.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index d1a3a8540b..c46e7cbcfa 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15196,8 +15196,8 @@ When a buffer is unmodified, it is just killed.  When 
modified, it is saved
                 (append org-todo-keyword-alist-for-agenda org-todo-key-alist))
           (setq org-tag-alist-for-agenda
                 (org--tag-add-to-alist
-                 org-tag-alist-for-agenda
-                 org-current-tag-alist))
+                 org-current-tag-alist
+                  org-tag-alist-for-agenda))
           ;; Merge current file's tag groups into global
           ;; `org-tag-groups-alist-for-agenda'.
           (when org-group-tags



reply via email to

[Prev in Thread] Current Thread [Next in Thread]