0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 19:07:52 +00:00

org-element: Small refactoring

* lisp/org-element.el (org-element--cache-generate-key): Small
  refactoring.
This commit is contained in:
Nicolas Goaziou 2014-06-26 22:00:27 +02:00
parent db995f2b9d
commit 16c71d6b78

View file

@ -4817,11 +4817,8 @@ lesser than UPPER, per `org-element--cache-key-less-p'."
((car upper))
(t most-positive-fixnum))))
(if (< (1+ min) max)
(let* ((mean (+ (ash min -1) (ash max -1)))
;; Fix MEAN when both MIN and MAX are odd.
(new (if (zerop (logand min max 1)) mean (1+ mean))))
;; Ensure we don't return a singleton.
(throw 'exit (if key (nreverse (cons new key)) new)))
(let ((mean (+ (ash min -1) (ash max -1) (logand min max 1))))
(throw 'exit (if key (nreverse (cons mean key)) mean)))
(when (and (< min max) (not skip-upper))
;; When at a given level, LOWER and UPPER differ from
;; 1, ignore UPPER altogether. Instead create a key