org-element--cache-sync: Quit early when no cache requests are queued

* 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.
This commit is contained in:
Ihor Radchenko 2022-09-16 12:31:32 +08:00
parent 6d8d7fba61
commit 1de67d0b41
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 1 additions and 1 deletions

View File

@ -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))