]> git.eshelyaron.com Git - emacs.git/commit
Avoid some syscalls in locate-dominating-file
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 16 Jul 2025 15:43:14 +0000 (08:43 -0700)
committerEshel Yaron <me@eshelyaron.com>
Thu, 24 Jul 2025 11:53:13 +0000 (13:53 +0200)
commit524e3b9641aeea77e05fb58de823695af35c79e8
treeff8eda783e604782938fc1a9e80ab6fd53e4af35
parente1f10777e463524d6144fc6caab14fd528dbcb9e
Avoid some syscalls in locate-dominating-file

* lisp/files.el (locate-dominating-file): Do not call
file-directory-p each time through a loop ascending the directory
hierarchy, as the file must be a directory after the first loop
iteration.  Instead, call file-directory-p just once, before the
loop starts, and do this only if the file name is not already that
of a directory.

(cherry picked from commit 2074951c2adff43be49822c344d6cf3fee2e29a5)
lisp/files.el