Skip to content

Commit

Permalink
org-element-map: Avoid repetitive `plist-get' call
Browse files Browse the repository at this point in the history
* lisp/org-element.el (org-element-map): Do not call `(plist-get info
:ignore-list)' on every iteration.
  • Loading branch information
yantar92 committed Jun 16, 2022
1 parent a158b26 commit 37a447a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lisp/org-element.el
Original file line number Diff line number Diff line change
Expand Up @@ -4612,6 +4612,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)
Expand All @@ -4621,7 +4622,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.
Expand Down

0 comments on commit 37a447a

Please sign in to comment.