Skip to content

Commit

Permalink
org-element--cache-sync: Quit early when no cache requests are queued
Browse files Browse the repository at this point in the history
* lisp/org-element.el (org-element--cache-sync): Check
`org-element--cache-sync-requests' value early and quit if there are
none.  This reduces the number of conditions checked when the request
queue is empty.
  • Loading branch information
yantar92 committed Sep 16, 2022
1 parent 6d8d7fb commit 1de67d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lisp/org-element.el
Original file line number Diff line number Diff line change
Expand Up @@ -5953,7 +5953,7 @@ actually submitted."
;; Do not sync when, for example, in the middle of
;; `combine-change-calls'. See the commentary inside
;; `org-element--cache-active-p'.
(when (org-element--cache-active-p)
(when (and org-element--cache-sync-requests (org-element--cache-active-p))
;; Check if the buffer have been changed outside visibility of
;; `org-element--cache-before-change' and `org-element--cache-after-change'.
(if (/= org-element--cache-last-buffer-size (buffer-size))
Expand Down

0 comments on commit 1de67d0

Please sign in to comment.