org-element: Tiny refactoring

* lisp/org-element.el (org-element-map): Reduce consing and improve
  readability at the price of a tiny code duplication.
This commit is contained in:
Nicolas Goaziou 2015-01-26 19:45:45 +01:00
parent 30b0c09275
commit 96b02fa9a6
1 changed files with 6 additions and 6 deletions

View File

@ -4038,12 +4038,12 @@ looking into captions:
(cond
((not value))
((member kwd org-element-dual-keywords)
(dolist
(line (if (member kwd org-element-multiple-keywords)
(reverse value)
(list value)))
(funcall --walk-tree (cdr line))
(funcall --walk-tree (car line))))
(if (member kwd org-element-multiple-keywords)
(dolist (line (reverse value))
(funcall --walk-tree (cdr line))
(funcall --walk-tree (car line)))
(funcall --walk-tree (cdr value))
(funcall --walk-tree (car value))))
((member kwd org-element-multiple-keywords)
(mapc --walk-tree (reverse value)))
(t (funcall --walk-tree value))))))