mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 04:10:54 -08:00
Make file-parent-directory more efficient
* lisp/files.el (file-parent-directory): Use equal instead of file-equal-p to compare the found parent and the child (bug#56355). This is much faster.
This commit is contained in:
parent
e7193902b2
commit
f0319cd86f
1 changed files with 3 additions and 1 deletions
|
|
@ -5196,7 +5196,9 @@ to `default-directory', and the result will also be relative."
|
|||
(cond
|
||||
;; filename is at top-level, therefore no parent
|
||||
((or (null parent)
|
||||
(file-equal-p parent expanded-filename))
|
||||
;; `equal' is enough, we don't need to resolve symlinks here
|
||||
;; with `file-equal-p', also for performance
|
||||
(equal parent expanded-filename))
|
||||
nil)
|
||||
;; filename is relative, return relative parent
|
||||
((not (file-name-absolute-p filename))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue