From e6a6b3da88b89b6d4d15d11c964c4d7e354234b4 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Sat, 29 Sep 2018 13:04:04 +0300 Subject: [PATCH] [#1147] Don't convert paths returned by external commands to relative External tools should return relative paths by default. This conversion was just one giant performance bottleneck. --- projectile.el | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/projectile.el b/projectile.el index 1d95a6b92..3faab3f76 100644 --- a/projectile.el +++ b/projectile.el @@ -1060,7 +1060,7 @@ Files are returned as relative paths to the project ROOT." (if (eq projectile-indexing-method 'native) (projectile-dir-files-native root directory) ;; use external tools to get the project files - (projectile-adjust-files (projectile-dir-files-external root directory)))))) + (projectile-adjust-files (projectile-dir-files-external directory)))))) (defun projectile-dir-files-native (root directory) "Get the files for ROOT under DIRECTORY using just Emacs Lisp." @@ -1073,12 +1073,10 @@ Files are returned as relative paths to the project ROOT." (projectile-index-directory directory (projectile-filtering-patterns) progress-reporter)))) -(defun projectile-dir-files-external (root directory) - "Get the files for ROOT under DIRECTORY using external tools." +(defun projectile-dir-files-external (directory) + "Get the files for DIRECTORY using external tools." (let ((default-directory directory)) - (mapcar (lambda (file) - (file-relative-name (expand-file-name file directory) root)) - (projectile-get-repo-files)))) + (projectile-get-repo-files))) (defun projectile-get-ext-command () "Determine which external command to invoke based on the project's VCS."