Переглянути джерело

Backport commit 4f37a3b29 from Emacs

* lisp/org-element.el (org-element-map): Do not call `(plist-get info
:ignore-list)' on every iteration.

org-element-map: Avoid repetitive `plist-get' call
4f37a3b299bcec71a0e9bdd84b7b226494006fe4
Ihor Radchenko
Thu Jun 16 10:54:14 2022 +0300

[ km: This ported commit comes from main's 37a447ae0.  I'm applying it
  here too for bookkeeping/traceability purposes.  ]
Ihor Radchenko 2 роки тому
батько
коміт
0da6c49f75
1 змінених файлів з 2 додано та 1 видалено
  1. 2 1
      lisp/org-element.el

+ 2 - 1
lisp/org-element.el

@@ -4391,6 +4391,7 @@ looking into captions:
 		       ;; every element it encounters.
 		       (and (not (eq category 'elements))
 			    (setq category 'elements))))))))
+         (--ignore-list (plist-get info :ignore-list))
 	 --acc)
     (letrec ((--walk-tree
 	      (lambda (--data)
@@ -4400,7 +4401,7 @@ looking into captions:
 		  (cond
 		   ((not --data))
 		   ;; Ignored element in an export context.
-		   ((and info (memq --data (plist-get info :ignore-list))))
+		   ((and info (memq --data --ignore-list)))
 		   ;; List of elements or objects.
 		   ((not --type) (mapc --walk-tree --data))
 		   ;; Unconditionally enter parse trees.