mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-04 06:31:13 -08:00
vc-buffer-sync-fileset: Reorder some checks for speed (bug#79137)
* lisp/vc/vc.el (vc-buffer-sync-fileset): Check whether a buffer's file is in one of our directories before checking whether it exists on disk. This should mean far fewer system calls overall (bug#79137).
This commit is contained in:
parent
e9800cabff
commit
ea7aee894d
1 changed files with 3 additions and 2 deletions
|
|
@ -2506,14 +2506,15 @@ buffers whose files exist on disk. Otherwise it syncs all of them."
|
|||
(lambda (buf)
|
||||
(and-let*
|
||||
((file (buffer-local-value 'buffer-file-name buf))
|
||||
((or missing-in-dirs (file-exists-p file)))
|
||||
((cl-some (if not-essential
|
||||
(lambda (dir)
|
||||
;; For speed (bug#79137).
|
||||
(string-prefix-p dir file))
|
||||
(lambda (dir)
|
||||
(file-in-directory-p file dir)))
|
||||
dirs)))))))))
|
||||
dirs))
|
||||
((or missing-in-dirs
|
||||
(file-exists-p file))))))))))
|
||||
(dolist (buf buffers)
|
||||
(with-current-buffer buf
|
||||
(vc-buffer-sync not-essential)))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue