Browse Source

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.
Ihor Radchenko 2 years ago
parent
commit
1de67d0b41
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lisp/org-element.el

+ 1 - 1
lisp/org-element.el

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